Python module from GitHub installed using setup.py can't see own submodules

不羁岁月 提交于 2019-12-12 03:05:36

问题


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



来源:https://stackoverflow.com/questions/40850108/python-module-from-github-installed-using-setup-py-cant-see-own-submodules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!