0

I am working on deploying an app in RShiny that uses the Reticulate package.

When running the app locally I have no issues as a virtual environment is not needed but once I try to create the virtual environment in R, this is my code:

py_install(envname='py_env_FF', method = 'virtualenv', conda='auto', packages=c('pandas', 'numpy')) Error: Installing Python packages into a virtualenv is not supported on Windows

I also tried the "auto" method as below but still no luck: py_install(envname='py_env_FF', method = 'auto', conda='auto', packages=c('pandas', 'numpy','joblib', 'requests', 'geopy', 'sklearn'), pip =TRUE) Sys.setenv('py_env_FF')

Here is the error:

C:\Users\Analytics\Documents>conda.bat activate py_env_FF 'pip' is not recognized as an internal or external command, operable program or batch file. Error: Error 1 occurred installing packages into conda environment py_env_FF In addition: Warning messages: 1: In normalizePath(path.expand(path), winslash, mustWork) : path[1]="C:\Users\Analytics\Anaconda3\envs\py_env_2\envs\py_env_FF/python.exe": The system cannot find the file specified 2: In normalizePath(path.expand(path), winslash, mustWork) : path[1]="C:\Users\Analytics\Anaconda3\envs\py_env_FF/python.exe": The system cannot find the file specified 3: In normalizePath(path.expand(path), winslash, mustWork) : path[1]="C:\Users\Analytics\Documents\py_env_FF/python.exe": The system cannot find the file specified 4: In normalizePath(path.expand(path), winslash, mustWork) : path[1]="C:\Users\Analytics\Anaconda3\envs\py_env_2\envs\py_env_FF/python.exe": The system cannot find the file specified 5: In normalizePath(path.expand(path), winslash, mustWork) : path[1]="C:\Users\Analytics\Anaconda3\envs\py_env_FF/python.exe": The system cannot find the file specified 6: In normalizePath(path.expand(path), winslash, mustWork) : path[1]="C:\Users\Analytics\Documents\py_env_FF/python.exe": The system cannot find the file specified

Previously I also tried manually creating a conda virtual environment using command, but apparently conda environments are not compatible with RShiny.

Any help would be much appreciated.

Fiona
  • 3
  • 4
  • Try it with `method='conda'` and don't use `pip`. – merv Sep 09 '19 at 22:43
  • I have to use pip for sklearn because you cant install sklearn with conda – Fiona Sep 10 '19 at 15:33
  • If you mean that you need to use `import sklearn`, the package is (very confusingly) different from the module name. The package is `scikit-learn` and that is on Conda. [The only `sklearn` on PyPI](https://pypi.org/project/sklearn/) is a just a stub that reads: "Use `scikit-learn` instead." – merv Sep 10 '19 at 15:44

0 Answers0