我的项目具有如下文件结构:
MyParserPkg/
setup.py
requirements.txt
readme.txt
MANIFEST.in
doc/
logs/
ParserPKG/
// many python files here
parser.py
config.a.ini
config.b.ini
舱单内容为:
include README.txt requirements.txt
include ParserPkg/config.a.ini
include ParserPkg/config.b.ini
我的设置.py地址:
setup(name='ParserPkg',
version='0.1',
description='A parser for testing',
packages=['ParserPkg'],
zip_safe=False)
然后我会:
pip install -r requirements.txt
pip install -e .
安装完成后,我检查了安装项目的虚拟环境的站点包,发现其中只包含一个文件:
my-envs/dialog-as-api/lib/python3.7/site-packages/ParserPkg.egg-link
以及此文件的内容,即我的项目的路径:
/Users/lvisa/MyParserPkg
为什么它只包含一个egg链接文件?你知道吗
您使用的是
-e
标志,它使包可编辑。根据the documentation以下链接提供:
因此,它“安装”它的意义是,它可供任何其他模块使用,但它实际上并不复制文件,因此您可以编辑代码并立即测试它。你知道吗
pip install -e .
以“可编辑”模式安装包。它会创建链接,并允许您编辑源代码而无需不断重新安装。你知道吗所以你的软件包安装正确。这就是“可编辑”模式的工作原理。你知道吗
试试
python -c 'import MyParserPkg'
相关问题 更多 >
编程相关推荐