Python包似乎忽略了我的需求

2024-09-30 14:25:45 发布

您现在位置:Python中文网/ 问答频道 /正文

我创建了我的第一个包。当我尝试用pip在新创建的virtualenv中安装它时,我得到一个错误,指示不能导入libs,但是它们被添加到setup.py中的install_requires字段中。如果我在维鲁阿连夫外面做,一切都没问题。 我的设置.py在这里:https://github.com/tdi/pyPEPA/blob/dev/setup.py

要重现错误:

mkvirtualenv something -p /usr/bin/python3
workon something
pip install pypepa

一。在

^{pr2}$

Tags: installpippyhttpsgithubcomvirtualenv错误
2条回答

Python3使用distutils,setup()将使用requires关键字参数。来自the docs

Dependencies on other Python modules and packages can be specified by supplying the requires keyword argument to setup().

把你的install_requires改成requires设置.py脚本。在

安装脚本导入pypepapypepa.pepa_模型它导入了pyparsing,但是pyparsing还没有安装(我们甚至还没有运行完安装脚本来知道依赖关系是什么)。解决方案是在pypepa和设置.py(这样您就可以删除导入),或者不在\uu init_uu.py中导入PEPAModel。在

相关问题 更多 >