rminiconda icon indicating copy to clipboard operation
rminiconda copied to clipboard

pip install fails

Open espinielli opened this issue 5 years ago • 4 comments

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)

espinielli avatar Oct 25 '19 12:10 espinielli

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

hafen avatar Oct 25 '19 17:10 hafen

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?

espinielli avatar Oct 28 '19 13:10 espinielli

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

hafen avatar Oct 28 '19 16:10 hafen

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

xhdong-umd avatar Dec 31 '19 02:12 xhdong-umd