简体   繁体   中英

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)

then when I run

$ python 
>>> from finsymbols import symbols

I get

File "", line 1, in ImportError: No module named finsymbols

My question is, why am I getting the error when the module is installed?

You may have multiple versions of 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)

Pip has installed it in python2.7 path. Your default Python may be different.

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

pip3 install module_name

Or link the pip3 executable in /usr/bin to replace pip . In this way, you can use pip to install Python 3.x modules.

Here I strongly recommend to use virtualenv to manage your Python module environments. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM