假设我有一个独立于任何Python机制构建的本机共享库(.dll或.so),以及一个使用ctypes连接到库的Python模块.有没有办法可以将它们构建成.whl包?如果是这样,怎么样?
假设这是可能的,我想我需要安装和使用轮组件,python setup.py bdist_wheel但我的setup.py需要看起来像什么?
我想这样做,所以我可以将各种平台的车轮上传到一个私有包索引,并能够为我所在的平台安装合适的一个.
有没有办法配置easy_install以避免在安装失败时再次下载文件?
我正在尝试通过运行pip install spacypython版本3.6.1来安装spacy 但是我不断地遇到如下错误,如何摆脱这个问题?以前我没有找到cl.exe错误,之后我在cl.exe存在的环境变量中添加了visual studio路径.
Failed building wheel for spacy
Running setup.py clean for spacy
Running setup.py bdist_wheel for murmurhash ... error
Complete output from command c:\users\sh00428701\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\SH0042~1\\AppData\\Local\\Temp\\pip-build-joi6voav\\murmurhash\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\SH0042~1\AppData\Local\Temp\tmpa6tzdkovpip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
----------------------------------------
Failed building wheel for murmurhash
Running setup.py clean for murmurhash
Running setup.py bdist_wheel for cymem ... error
Complete output from command c:\users\sh00428701\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\SH0042~1\\AppData\\Local\\Temp\\pip-build-joi6voav\\cymem\\setup.py';f=getattr(tokenize, …Run Code Online (Sandbox Code Playgroud) 我想在我的Windows系统上安装MySqlclient.我目前正在使用Python 3.6.经过Stackoverflow上的各种帖子后,我找不到正确的方法.这是我到目前为止所做的:
1)使用pip进行安装pip install mysqlclient.错误:
需要Microsoft Visual C++ 14.0.使用"Microsoft Visual C++构建工具"获取它http://landinghub.visualstudio.com/visual-cpp-build-tools
我已经在笔记本电脑上安装了Microsoft Visual C++.有人说你需要2015版.
2)使用wheel文件安装pip install mysqlclient-1.3.13-cp36-cp36m-win_amd64.whl.错误:
要求
mysqlclient-1.3.13-cp36-cp36m-win_amd64.whl看起来像文件名,但文件不存在.mysqlclient-1.3.13-cp36-cp36m-win_amd64.whl不是此平台上支持的滚轮.
2.1)将whl文件更改为不同的版本pip install mysqlclient-1.3.13-cp36-cp36m-win32.whl.错误:
由于EnvironmentError导致无法安装软件包:[Errno 2]没有这样的文件或目录:
'C:\\Users\\Foxtrot\\Desktop\\finaltest\\mysqlclient-1.3.13-cp36-cp36m-win32.whl'
完成的其他事情:更新的setuptools,更新的轮子.
我尝试安装pyaudio,但它返回如下错误:
Could not build wheels for pyaudio, since package 'wheel' is not installed.
Run Code Online (Sandbox Code Playgroud)

我怎样才能解决这个问题?
我认为它没有区别,但我使用的是Python 2.7.
所以我的问题的一般部分如下:我virtualenv为每个项目使用一个单独的.我没有管理员权限,我也不想乱用系统安装的软件包.当然,我想使用轮子加速整个包的升级和安装virtualenv.如何构建一个仅在特定范围内满足依赖性的轮子virtualenv?
具体来说,发行
pip wheel -w $WHEELHOUSE scipy
Run Code Online (Sandbox Code Playgroud)
失败了
Building wheels for collected packages: scipy
Running setup.py bdist_wheel for scipy
Destination directory: /home/moritz/.pip/wheelhouse
Complete output from command /home/moritz/.virtualenvs/base/bin/python -c "import setuptools;__file__='/home/moritz/.virtualenvs/base/build/scipy/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /home/moritz/.pip/wheelhouse:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/moritz/.virtualenvs/base/build/scipy/setup.py", line 237, in <module>
setup_package()
File "/home/moritz/.virtualenvs/base/build/scipy/setup.py", line 225, in setup_package
from numpy.distutils.core import setup
ImportError: No module named numpy.distutils.core
----------------------------------------
Failed building …Run Code Online (Sandbox Code Playgroud) 通过几个项目看最近,我注意到他们中的一些使用platforms到参数setup()中setup.py,虽然与只有一个值any,即
#setup.py file in project's package folder
...
setup(
...,
platforms=['any'],
...
)
Run Code Online (Sandbox Code Playgroud)
要么
#setup.py file in project's package folder
...
setup(
...,
platforms='any',
...
)
Run Code Online (Sandbox Code Playgroud)
从名称"平台",我可以猜测这个参数意味着什么,似乎列表变体是正确的用法.
所以我用谷歌搜索,查看了setuptools文档,但是我没有找到任何解释,它们可能的值是platforms什么,它在包中的作用/影响是什么.
请解释或提供一个链接,解释它究竟做了什么以及它接受了什么值?
PS还尝试在我的OS独立包中提供不同的值,看看在创建轮子时有什么变化,但它似乎什么也没做.
可以在不使用的情况下安装Python滚轮pip吗?我总是遇到安装问题pip,所以我通常通过复制和粘贴手动安装库.我想知道是否有办法以类似的方式做轮文件.
我尝试在 Ubuntu 20.04.01 上安装 watchman:
guettli@yoga15:~/tmp$ python3 -m venv pywatchman-test
guettli@yoga15:~/tmp$ cd pywatchman-test
guettli@yoga15:~/tmp/pywatchman-test$ . bin/activate
(pywatchman-test) guettli@yoga15:~/tmp/pywatchman-test$ pip install pywatchman
Run Code Online (Sandbox Code Playgroud)
失败:
Collecting pywatchman
Using cached pywatchman-1.4.1.tar.gz (29 kB)
Building wheels for collected packages: pywatchman
Building wheel for pywatchman (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/guettli/tmp/pywatchman-test/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-on_zbadt/pywatchman/setup.py'"'"'; __file__='"'"'/tmp/pip-install-on_zbadt/pywatchman/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-9np2rv_b
cwd: /tmp/pip-install-on_zbadt/pywatchman/
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 …Run Code Online (Sandbox Code Playgroud) python ×10
python-wheel ×10
pip ×4
scipy ×2
easy-install ×1
egg ×1
mysql-python ×1
pyaudio ×1
pypi ×1
setup.py ×1
setuptools ×1
spacy ×1
virtualenv ×1
watchman ×1