使用python setuptools entry_points导入其他文件 - 未命名的模块
我不熟悉Setuptools,所以我希望这是一个简单的错误(但找不到任何相关的错误)。
我在我的setup.py
entry_points={
'console_scripts':[
'filea=autostart.filea:main'
]
}
和我的autostart.filea
from fileb import ClassName
中有此功能(filea和fileb都在autostart内部),
当我运行时,该工程文件在我的运行时
python autostart/filea.py
,而不是直接运行
filea
二进制文件时。
在这种情况下,我
packages/autostart/filea.py", line 15, in <module>
from fileb import ClassName
ModuleNotFoundError: No module named 'fileb'
会得到任何帮助,感谢您。
I am not familiar with setuptools so I hope this is a simple mistake (but couldn't find anything related).
I have this in my setup.py
entry_points={
'console_scripts':[
'filea=autostart.filea:main'
]
}
And my autostart.filea has
from fileb import ClassName
(filea and fileb are both inside autostart)
This works file when I run
python autostart/filea.py
but not when I run the
filea
binary directly.
In this case I get
packages/autostart/filea.py", line 15, in <module>
from fileb import ClassName
ModuleNotFoundError: No module named 'fileb'
Any help would be appreciated, thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论