I have a pre-existing virtual environment set up for my python requirements, D:/SC/venv. I am trying to import data from a pickle into RStudio. I gather that in order to do so, I need to run a python script to read the pickle in RStudio using reticulate. However, when I run:
use_virtualenv("D:/SourceControl/sportsenv")
path_to_python <- "D:/SourceControl/sportsenv"
use_python(path_to_python)
source_python("pickle_reader.py")
I get the following error message:
Error in py_run_file_impl(file, local, convert) :
ModuleNotFoundError: No module named 'pandas'
Pandas is installed and can be used with python directly. I think this is a problem with setting the virtual environment, as when I run py_config() I get:
> py_config()
python: C:/Program Files/Python37/python.exe
libpython: C:/Program Files/Python37/python37.dll
pythonhome: C:/Program Files/Python37
version: 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]
Architecture: 64bit
numpy: C:/Users/.../AppData/Roaming/Python/Python37/site-packages/numpy
numpy_version: 1.17.4
So I guess it hasn't recognised my virtual environment.
pandas
installed globally or in the virtualenv? – Flagellavirtualenv_list()
to get a list of available virtual environments. – Staves