Python module from GitHub installed using setup.py

2019-09-11 14:22发布

问题:

I downloaded python-somelib-master.zip from GitHub hoping to use the API it provides. I ran

python setup.py install

And it apparently completed successfully:

Writing D:\SOFT\Python3\Lib\site-packages\python-somelib-1.0-py3.5.egg-info

which then introduced D:\SOFT\Python3\Lib\site-packages\somelib.

However, when I try to import something from there in my script:

from somelib import SubModule

I get

  File "D:\SOFT\Python3\lib\site-packages\somelib\__init__.py", line 1, in <module>
    from base import SubModule
ImportError: No module named 'base'

I confirmed that base.py is present in D:\SOFT\Python3\Lib\site-packages\somelib.

Did I not properly install the module?

回答1:

You must install modules dependencies in your machine too. If you are using Ubuntu, you can easily do it with "apt-get". Hope it helps! xD