尝试使用:
pip install --no-binary :all: somepackage
pip
在PyPI上下载源代码分发包,但我不知道为什么PyQt5没有源代码包,可能是因为它们不能用pip
安装,需要一个完整的编译工具链。
提供二进制文件而不是源代码可以吗?
只要同时提供二进制文件和源代码就可以。我建议你这样做。
python setup.py bdist_wheel
。您需要安装wheel
包(在PyPI上)才能使其正常工作。如果您的软件包支持Python 2和3,并且不包含C扩展,则添加--universal
选项以创建"通用轮子"。bdist_wheel
替换为sdist
以创建源分发。它将在dist
目录中创建一个存档文件。
sdist creates the archive of the default format for the current platform. The default format is a gzip’ed tar file (
.tar.gz
) on Unix, and ZIP file on Windows.You can specify as many formats as you like using the
--formats
option, for example:python setup.py sdist --formats=gztar,zip
to create a gzipped tarball and a zip file
(摘自 https://docs.python.org/3/distutils/sourcedist.html)
关于打包和轮子的更多信息,请点击这里:https://packaging.python.org/distributing/#packaging-your-project