python3.7,centos7.2和pip 18。
该项目具有以下结构。当我运行pip install -e .
,然后proxy-tools
运行正常时。
但是,当我运行python setup.py sdist
并运行pip install proxy-tools-1.0.0.tar.gz
时,proxy-tools
给出了错误
Traceback (most recent call last):
File "/home/tiina/proxy-tools-runtime/venv/bin/proxy-tools", line 6, in <module>
from proxy_tools.agent.http_server2 import main
ModuleNotFoundError: No module named 'proxy_tools'
文件夹结构:
.
|-- dist
|-- MANIFEST.in
|-- proxy_tools
|-- proxy_tools.egg-info
|-- setup.py
`-- venv
和setup.py
from setuptools import setup, find_packages
setup(
name='proxy_tools',
version='1.0.0',
packages=find_packages(),
include_package_data=True,
install_requires=[
'alabaster',
],
entry_points="""
[console_scripts]
proxy-tools = proxy_tools.agent.http_server2:main
""",
)
因为它是python3.7,所以每个模块都是从proxy_tools
导入的