这是我的项目代码结构:
pynique
├── cli
│ ├── __init__.py
│ └── pynique_ops.py
├── pynique
│ ├── __init__.py
├── README.md
├── setup.cfg
└── setup.py
我的setup.py
内容是:
from setuptools import (
find_packages,
setup
)
print find_packages()
setup(
name='pynique',
version='0.1.1.dev1',
description='pynique app',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)'
],
packages=find_packages(exclude=['tests']),
include_package_data=True,
install_requires=[
'jinja2',
'PyYAML',
'Click'
],
entry_points='''
[console_scripts]
start-pynique=pynique.cli.pynique_ops:start
''',
)
我在 pynique 顶级文件夹项目中完成了此操作:-pip install -e .
但我start-pynique
的不工作,它抛出这个错误:
Traceback (most recent call last):
File "/home/agung/.virtualenvs/pynique/bin/start-pynique", line 11, in <module>
load_entry_point('pynique', 'console_scripts', 'start-pynique')()
File "/home/agung/.virtualenvs/pynique/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 542, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/agung/.virtualenvs/pynique/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2569, in load_entry_point
return ep.load()
File "/home/agung/.virtualenvs/pynique/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2229, in load
return self.resolve()
File "/home/agung/.virtualenvs/pynique/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2235, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
ImportError: No module named cli.pynique_ops
(pynique)
你知道为什么它没有命名模块cli.pynique_ops
吗?我的 setup.py 有什么问题吗?