我已经安装了Anaconda,但在python上运行代码时仍然无法使用pandas和requests等包。
当我在终端上输入python时,它显示:
Python 3.6.1 |Anaconda 4.4.0 (x86_64)| (default, May 11 2017, 13:04:09)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.我还创建了一个虚拟环境,并在打开python shell之前激活:
conda create -n my-env python=3.6 anaconda但是,当在Python上重新打开并运行代码时,它总是说“没有名为'pandas‘的模块或’没有名为‘request’的模块”,有人知道这段代码的问题是什么吗?另外,我不知道Python的版本是否与这个错误有关?是因为我使用的是3.6.2 Python而不是3.6.1吗?
发布于 2017-10-07 02:39:18
Anaconda可能成为您系统上的默认Python安装。特别是当你使用一个新环境时,你必须在这个新环境中安装你想要的模块。
先试试conda install pandas,然后试试import pandas
https://stackoverflow.com/questions/46611869
复制相似问题