[英]pip install error - ImportError: No module named finsymbols
When I run: 当我跑:
sudo -H pip install finsymbols
I get the below response: 我收到以下回复:
Requirement already satisfied: finsymbols in /usr/local/lib/python2.7/dist-packages Requirement already satisfied: beautifulsoup4>=4.2.1 in /usr/local/lib/python2.7/dist-packages (from finsymbols)
要求已经满足:/usr/local/lib/python2.7/dist-packages中的finsymbols要求已经满足:/usr/local/lib/python2.7/dist-packages中的beautifulsoup4> = 4.2.1(来自finsymbols)
then when I run 然后当我跑
$ python
>>> from finsymbols import symbols
I get 我明白了
File "", line 1, in ImportError: No module named finsymbols
ImportError中的文件“”,第1行:没有名为finsymbols的模块
My question is, why am I getting the error when the module is installed? 我的问题是,为什么我在安装模块时收到错误?
You may have multiple versions of Python. 您可能有多个版本的Python。
Requirement already satisfied: finsymbols in /usr/local/lib/ python2.7 /dist-packages Requirement already satisfied: beautifulsoup4>=4.2.1 in /usr/local/lib/python2.7/dist-packages (from finsymbols) 要求已经满足:/ usr / local / lib / python2.7 / dist-packages中的finsymbols要求已经满足:/usr/local/lib/python2.7/dist-packages中的beautifulsoup4> = 4.2.1(来自finsymbols)
Pip has installed it in python2.7 path. Pip已经在python2.7路径中安装了它。 Your default Python may be different.
您的默认Python可能不同。
So try using 所以尝试使用
$ python2.7
instead of 代替
$ python
If you want to install a module that runs on Python 3.x, you need to use 如果要安装在Python 3.x上运行的模块,则需要使用
pip3 install module_name
Or link the pip3
executable in /usr/bin
to replace pip
. 或者链接
/usr/bin
的pip3
可执行文件来替换pip
。 In this way, you can use pip
to install Python 3.x modules. 通过这种方式,您可以使用
pip
来安装Python 3.x模块。
Here I strongly recommend to use virtualenv
to manage your Python module environments. 在这里,我强烈建议使用
virtualenv
来管理您的Python模块环境。 More details can be found here . 更多细节可以在这里找到。
Thanks jonatan, that worked. 谢谢乔纳坦,这很有效。
I ran 我跑了
pip install finsymbols
not 不
sudo -H pip install finsymbols
and that fixed the issue 并解决了这个问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.