我正在尝试安装我刚刚在本地开发的软件包(Python 3.6,setuptools 35.0.2),我看到了成功消息:
Copying mon_agent-0.0.1-py3.6.egg to /home/jgu/repos/.venv36/lib/python3.6/site-packages
mon-agent 0.0.1 is already the active version in easy-install.pth
Installing mon_agent_worker.py script to /home/jgu/repos/.venv36/bin
Installed /home/jgu/repos/.venv36/lib/python3.6/site-packages/mon_agent-0.0.1-py3.6.egg
Processing dependencies for mon-agent==0.0.1
Finished processing dependencies for mon-agent==0.0.1
但是当我做pip freeze | grep mon
时(我做了pip list并且也找不到mon_agent)我什么都没看到,当我在命令行中键入mon_agent_worker时,它说命令不存在。
我可以打开python shell并导入mon_agent并打印出它的版本并正常使用它。但是我无法运行脚本 - 命令未找到
编辑:
我只是运行python setup.py bdist_wheel --universal
和pip install mon_agent-0.0.1-py2.py3-none-any.whl
并且脚本正在运行,pip freeze显示它
编辑(添加了我的setup.py以获取更多调试信息):
#!/usr/bin/env python
from __future__ import absolute_import, print_function
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import mon_agent
NAME = 'mon_agent'
PACKAGES = [
'mon_agent', 'mon_agent.collectors'
]
PACKAGE_DATA = {
'': ['resources/*.txt']
}
AUTHOR = mon_agent.__author__
AUTHOR_EMAIL = 'franklingujunchao@gmail.com'
URL = '***something***'
REQUIRES = []
with open('requirements.txt', 'r') as ifile:
for line in ifile:
REQUIRES.append(line.strip())
VERSION = mon_agent.__version__
DESCRIPTION = 'Log monitor agent'
KEYWORDS = 'monitor data log agent'
LONG_DESC = mon_agent.__doc__
setup(
name=NAME,
version=VERSION,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
description=DESCRIPTION,
long_description=LONG_DESC,
url=URL,
keywords=KEYWORDS,
scripts=['bin/mon_agent_worker'],
package_dir={'': './'},
packages=PACKAGES,
package_data=PACKAGE_DATA,
include_package_data=True,
install_requires=REQUIRES,
python_requires='>=3.5',
classifiers=[
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python',
],
)