I'm venturing into using Reticulate in R and having trouble installing a package, specifically psycopg2
but I've also tried installing twisted
with the same result.
after I load reticulate
in R I double check to make sure my package is installed:
> conda_install(envname = "r-reticulate", packages="psycopg2")
Solving environment: ...working... done
# All requested packages already installed.
Looks good. So I set my condaenv to r-reticulate
just to be double sure. The docs say I should not have to do this, but it should not hurt:
> use_condaenv( "r-reticulate")
Then I try to import psycopg2
:
> psycopg2 <- import('psycopg2')
Error in py_module_import(module, convert = convert) :
ImportError: No module named psycopg2
If I install twisted
the same way, I get the same error:
> twisted <- import('twisted')
Error in py_module_import(module, convert = convert) :
ImportError: No module named twisted
So, what am I doing wrong here?
Below is the output of conda_list
and py_config
... I was expecting py_config
to show me the path to the python exe in my r-reticulate
environment. However I don't have anything to compare this to, so my expectations may have been wrong.
> conda_list()
name python
1 Anaconda C:\\Users\\jal\\AppData\\Local\\Continuum\\Anaconda\\python.exe
2 r-reticulate C:\\Users\\jal\\AppData\\Local\\Continuum\\Anaconda\\envs\\r-reticulate\\python.exe
> py_config()
python: C:\Users\jal\AppData\Local\CONTIN~1\Anaconda\python.exe
libpython: C:/Users/jal/AppData/Local/CONTIN~1/Anaconda/python27.dll
pythonhome: C:\Users\jal\AppData\Local\CONTIN~1\Anaconda
version: 2.7.15 |Anaconda custom (64-bit)| (default, May 1 2018, 18:37:09) [MSC v.1500 64 bit (AMD64)]
Architecture: 64bit
numpy: C:\Users\jal\AppData\Local\CONTIN~1\Anaconda\lib\site-packages\numpy
numpy_version: 1.14.3
pandas: C:\Users\jal\AppData\Local\CONTIN~1\Anaconda\lib\site-packages\pandas
python versions found:
C:\Users\jal\AppData\Local\CONTIN~1\Anaconda\python.exe
C:\Users\jal\AppData\Local\CONTIN~1\ANACON~1\python.exe