我正在尝试从github安装Exscript。
pip install -e 'git+git://github.com/knipknap/exscript.git#egg=Exscript'
...
Successfully installed Exscript
Cleaning up..当我试图加载它时,python找不到它:
python2.7 -c "import Exscript"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named Exscript但是,当我尝试在与setup.py相同的虚拟环境中安装它时,它成功地安装和加载了。
我做错了什么?
发布于 2012-05-19 00:58:13
标志-e的意思是“可编辑的”,幕后发生的事情是一个符号链接,正如我所看到的,Exscript使用了一个名为src的目录,这在一个好的practice1中是看不到的。
因此,为了解决您的问题,您有两种选择:
-e标志src,并使用另一个目录名看看https://the-hitchhikers-guide-to-packaging.readthedocs.io/en/latest/creation.html#arranging-your-file-and-directory-structure和https://setuptools.readthedocs.io/en/latest/userguide/development_mode.html。
1:最好的做法是使目录与导入包时使用的目录同名
https://stackoverflow.com/questions/10569846
复制相似问题