hafen / rminiconda

Install and maintain isolated miniconda Python installations from R
Apache License 2.0
67 stars 4 forks source link

pip install fails #9

Open espinielli opened 5 years ago

espinielli commented 5 years ago

The code below shows the error I get when trying to install a Python package (just used shap like in the README) in my miniconda.

library(rminiconda)

rminiconda::install_miniconda(path = "C:/Users/spi/dev/miniconda-test", name = "xyzzy")
#> Error in rminiconda::install_miniconda(path = "C:/Users/spi/dev/miniconda-test", : An installation already exists at:
#> C:\Users\spi\dev\miniconda-test\xyzzy
#> If you'd like to install a fresh version, first run:
#> remove_miniconda(path = "C:/Users/spi/dev/miniconda-test", name = "xyzzy")
Sys.setenv(R_MINICONDA_PATH = "C:/Users/spi/dev/miniconda-test")
Sys.getenv("R_MINICONDA_PATH")
#> [1] "C:/Users/spi/dev/miniconda-test"
rminiconda_pip_install("shap", "xyzzy")
#> Warning in rminiconda_pip_install("shap", "xyzzy"): There was an issue
#> installing Python module 'xyzzy'.

Created on 2019-10-25 by the reprex package (v0.3.0)

hafen commented 5 years ago

This works for me. Perhaps there's something Windows-specific going on?

espinielli commented 5 years ago

I think the issue is due to the fact that you need to control the environment (variables) you use when executing system2(). For example I was able to install via pip (on the command line) only after I prepended my PATH with the R_MINICONDA_PATH and the relevant Scripts, Library directories...and activated conda.

Have you tried to install in a non-default location? Does it work for you? On which OS?

hafen commented 5 years ago

Interesting. It worked for me in a non-default location on MacOS (following your example but with path /tmp/xyzzy.

xhdong-umd commented 4 years ago

In my windows machine, the same process have error due to ssl issue:

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping