为什么要在添加新脚本/子模块等之后再次运行setup.py develop
?在
例如,我这样做:
pyvenv venv
. venv/bin/activate
现在,创建以下文件:
^{pr2}$在(设置.py很简单,而且傻瓜包含一个功能) 然后
python setup.py develop
现在,如果启动python,就可以导入testpkg.foo
。在
但是现在,加上棒.py公司名称:
/
| setup.py
| testpkg
| | __init__.py
| | foo.py
| | bar.py <---
| |__
|__
无法导入testpkg.bar
除非你再跑一次
python setup.py develop
为什么?(为什么它不起作用,为什么要选择这种行为,如果它是预期的行为?)在
注释(和编辑)
在我的计算机上,运行python setup.py develop
之后,我注意到链接指向build/lib/[…].egg信息
在egg信息中,我看到源代码指向这个build/lib。这里的文件不是链接,那么它应该如何工作??在
检查是否设置了use TO3标志。然后,正如医生所说:
相关问题 更多 >
编程相关推荐