0

I am trying to source data from a python script to use in R. I am using Articulate and PyCharm.

The script imports the module GetOldTweets3 and runs fine on its own, but when I try to run it using Articulate, I get Exception: ModuleNotFoundError: No module named 'GetOldTweets3'

py_config() gives me:

python:         C:/Users/<username>/AppData/Local/r-miniconda/envs/r-reticulate/python.exe
libpython:      C:/Users/<username>/AppData/Local/r-miniconda/envs/r-reticulate/python36.dll
pythonhome:     C:/Users/<username>/AppData/Local/r-miniconda/envs/r-reticulate
version:        3.6.10 |Anaconda, Inc.| (default, Mar 23 2020, 17:58:33) [MSC v.1916 64 bit (AMD64)]
Architecture:   64bit
numpy:          C:/Users/<username>/AppData/Local/r-miniconda/envs/r-reticulate/Lib/site-packages/numpy
numpy_version:  1.18.1

Running conda list in a terminal shows it there (in the pypi channel).

I am calling the python script using source_python().

4

1 回答 1

0

确保激活 conda 虚拟环境

看起来 numpy 已安装在您的个人 r-retuculate python 虚拟环境中。确保激活与已安装的 python 包关联的虚拟环境。

library(reticulate)
use_virtualenv("r-reticulate")
于 2020-03-30T15:07:39.933 回答