【发布时间】:2016-07-01 04:24:15
【问题描述】:
我通过以下结构的 setup.py 在 pypi.python.org 上创建了包:
from setuptools import setup, find_packages
setup(
name='my_project',
version='1.0.0',
packages=find_packages(),
long_description='My project',
package_data={
"MyProject.libraries": [
"darwin/lib.so",
"linux/lib.so",
"windows/lib.pyd",
],
},
)
我的目录结构是
myproject/
--libraries/
----__init__.py
----darwin/
------lib.so
----linux/
------lib.so
----windows/
------lib.pyd
readme
setup.py
other files
使用 pip 安装时:
pip install my_project
我得到错误
Failed building wheel for myproject
Running setup.py clean for myproject
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-fsZH4w/myproject/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" clean --all:
Traceback (most recent call last):
File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: '/private/tmp/pip-build-fsZH4w/myproject/setup.py'
但软件包已安装并且工作正常。
我发现了类似的问题pip installation throws IOerror - no setup.py,但我的 setup.py 在根包目录中,所以我认为不是同一个问题。
【问题讨论】:
-
你检查命名一致性了吗?您同时拥有“my_project”、“MyProject”和“myproject”。我想它必须一直是一样的。