0

我正在使用带有 Python 3.6 的 Windows,到目前为止,对于许多其他软件包,运行都没有问题。

我正在尝试安装和使用 pandas-datareader,但是在我成功安装之后:

> C:\Python36\Scripts>pip3 install pandas-datareader Collecting
> pandas-datareader   Using cached
> pandas_datareader-0.5.0-py2.py3-none-any.whl Requirement already
> satisfied: requests>=2.3.0 in c:\python36\lib\site-packages (from
> pandas-datareader) Requirement already satisfied: requests-ftp in
> c:\python36\lib\site-packages (from pandas-datareader) Requirement
> already satisfied: pandas>=0.17.0 in c:\python36\lib\site-packages
> (from pandas-datareader) Requirement already satisfied: requests-file
> in c:\python36\lib\site-packages (from pandas-datareader) Requirement
> already satisfied: certifi>=2017.4.17 in c:\python36\lib\site-packages
> (from requests>=2.3.0->pandas-datareader) Requirement already
> satisfied: idna<2.7,>=2.5 in c:\python36\lib\site-packages (from
> requests>=2.3.0->pandas-datareader) Requirement already satisfied:
> urllib3<1.23,>=1.21.1 in c:\python36\lib\site-packages (from
> requests>=2.3.0->pandas-datareader) Requirement already satisfied:
> chardet<3.1.0,>=3.0.2 in c:\python36\lib\site-packages (from
> requests>=2.3.0->pandas-datareader) Requirement already satisfied:
> numpy>=1.9.0 in c:\python36\lib\site-packages (from
> pandas>=0.17.0->pandas-datareader) Requirement already satisfied:
> pytz>=2011k in c:\python36\lib\site-packages (from
> pandas>=0.17.0->pandas-datareader) Requirement already satisfied:
> python-dateutil>=2 in c:\python36\lib\site-packages (from
> pandas>=0.17.0->pandas-datareader) Requirement already satisfied: six
> in c:\python36\lib\site-packages (from
> requests-file->pandas-datareader) Installing collected packages:
> pandas-datareader Successfully installed pandas-datareader-0.5.0

当尝试在pycharm / jupyter中运行它时,我收到:

ModuleNotFoundError:没有名为“pandas_datareader”的模块

当我pip3 list在 cmd 命令中运行时,我可以看到它已安装(pandas (0.22.0) pandas-datareader (0.5.0))。

关于这个问题,我看了很多答案,但仍然无法解决这个问题。另外,我确定该目录已添加到 Windows 路径中。

4

1 回答 1

1

在您的每个环境中,运行一个快速程序:

import sys 
for p in sys.path: 
    print(p). 

将这些路径与 pip3 安装 pandas_datareader 的路径进行比较,即 c:\python36\lib\site-packages

您可能需要将它单独安装到 PyCharm 和 jupyter

于 2018-01-01T16:06:39.437 回答