我在我的Windows机器上安装Python软件包(特别是JPype1 0.5.7)时遇到了麻烦,并希望用Christoph Gohlke的Window二进制文件安装它.(根据我的经验,这可以减轻很多其他软件包安装的麻烦.)
然而,虽然Christoph过去常常提供.exe文件,但最近似乎他正在上传.whl文件.
http://www.lfd.uci.edu/~gohlke/pythonlibs/#jpype
但是如何安装.whl文件?
笔记:
以下是我正在运行的命令:
$ python setup.py bdist_wheel
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'bdist_wheel'
$ pip --version
pip 1.5.6 from /usr/local/lib/python3.4/site-packages (python 3.4)
$ python -c "import setuptools; print(setuptools.__version__)"
2.1
$ python --version
Python 3.4.1
$ which python
/usr/local/bin/python
Run Code Online (Sandbox Code Playgroud)
另外,我正在使用自制的python运行mac
这是我的setup.py脚本:https: //gist.github.com/cloudformdesign/4791c46fe7cd52eb61cd
我疯了 - 我无法弄清楚为什么这不起作用.
使用最近的(1.5)版本pip
,我在尝试更新多个包时遇到错误.例如,sudo pip install -U pytz
导致失败的原因是:
Wheel installs require setuptools >= 0.8 for dist-info support.
pip's wheel support requires setuptools >= 0.8 for dist-info support.
Run Code Online (Sandbox Code Playgroud)
我不明白这个消息(我有setuptools
2.1)或者该怎么做.
此错误的日志中的异常信息:
Exception information:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 230, in run
finder = self._build_package_finder(options, index_urls, session)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 185, in _build_package_finder
session=session,
File "/Library/Python/2.7/site-packages/pip/index.py", line 50, in __init__
self.use_wheel = use_wheel
File "/Library/Python/2.7/site-packages/pip/index.py", …
Run Code Online (Sandbox Code Playgroud) 如何安装.whl文件?我有Wheel库但我不知道如何使用它来安装这些文件.我有.whl文件,但我不知道如何运行它.请帮忙.
我正在尝试通过 pip 在我的 64 位 ARMV8 板上安装 scipy。我已经安装了 scipy 所需的 openblas。所以,没有问题。当我给时pip3 install scipy --trusted-host pypi.org --trusted-host files.pythonhosted.org
,我收到错误Failed building wheel for scipy。我有 pip3 和 pip3.5,/usr/bin
其余的 pip 都在/usr/lib64/python3.5/site-packages
。所以基本上,我也有 pip。
我还尝试使用--no-binary
选项安装 scipy ,这是网络上的答案之一。但是,它给了我同样的错误。下面是我得到的错误。
错误:
Collecting scipy
Downloading scipy-1.4.1.tar.gz (24.6 MB)
|################################| 24.6 MB 6.6 MB/s
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Building wheels for collected packages: scipy
Building wheel for scipy (PEP …
Run Code Online (Sandbox Code Playgroud) 我试图从whl文件安装numpy.我收到错误:
numpy-1.9.1%2Bmkl-cp34-none-win_amd64.whl is not a supported wheel on this platform.
Run Code Online (Sandbox Code Playgroud)
详细信息:Windows 8.1 pro x64,提升命令提示符
Python 3.4.2
来自Gohlke网站的包装numpy
numpy-1.9.1%2Bmkl-cp34-none-win_amd64.whl复制在pip.exe文件夹中
日志文件显示:
d:\ Program Files\WinPython-64bit-3.4.2.4\python-3.4.2.amd64\Scripts\pip run on 01/23/15 11:55:21 numpy-1.9.1%2Bmkl-cp34-none-win_amd64 .whl不是此平台上支持的滚轮.异常信息:Traceback(最近一次调用最后一次):文件"D:\ Python34\lib\site-packages\pip\basecommand.py",第122行,主状态= self.run(options,args)文件"D:\Python34\lib\site-packages\pip\commands\install.py",第257行,运行InstallRequirement.from_line(name,None))文件"D:\ Python34\lib\site-packages\pip\req.py ",第167行,在from_line中引发UnsupportedWheel("%s不是此平台上支持的轮子."%wheel.filename)pip.exceptions.UnsupportedWheel:numpy-1.9.1%2Bmkl-cp34-none-win_amd64.whl is这个平台上没有支持的轮子.
怎么了?
如何控制车轮中包含哪些文件?它似乎MANIFEST.in
没有被使用python setup.py bdist_wheel
.
更新:
从源tarball到wheel安装之间的区别我错了.源代码分发包括指定的文件MANIFEST.in
,但安装的软件包只有python文件.需要步骤来识别应安装的其他文件,无论安装是通过源分发,egg还是wheel.也就是说,其他包文件需要package_data,而命令行脚本或系统配置文件需要包外的文件的data_files.
我有一个项目,我一直python setup.py sdist
用来构建我的包,MANIFEST.in
控制包含和排除的文件,以及pyroma和check-manifest来确认我的设置.
我最近将它转换为双Python 2/3代码,并添加了一个setup.cfg
[bdist_wheel]
universal = 1
Run Code Online (Sandbox Code Playgroud)
我可以用python setup.py bdist_wheel
它来制造一个轮子,它看起来像是一个万向轮.但是,它不包括指定的所有文件MANIFEST.in
.
我挖得更深,现在更了解包装和轮子.这是我学到的东西:
我将两个包文件上传到PyPi上的multigtfs项目:
multigtfs-0.4.2.tar.gz
- 源tar球,包括所有文件MANIFEST.in
.multigtfs-0.4.2-py2.py3-none-any.whl
- 有问题的二进制分布.我创建了两个新的虚拟环境,都使用Python 2.7.5,并安装了每个包(pip install multigtfs-0.4.2.tar.gz
).这两种环境几乎完全相同.它们有不同的.pyc
文件,即"已编译"的Python文件.有记录磁盘上不同路径的日志文件.源tar球multigtfs-0.4.2-py27.egg-info
的安装包括一个文件夹,详细说明安装,并且wheel安装有一个multigtfs-0.4.2.dist-info
文件夹,其中包含该进程的详细信息.但是,从使用multigtfs项目的代码的角度来看,两种安装方法之间没有区别.
显然,我的测试使用的.zip文件都没有,因此测试套件将失败:
$ django-admin startproject demo
$ cd demo
$ pip …
Run Code Online (Sandbox Code Playgroud) 我在使用轮子时遇到了这个问题:“无法为……构建轮子,因为未安装包‘轮’。” 有几个包,我不知道该怎么做 - 正如你在最后看到的 - 我已经安装了轮包
我在 Ubuntu 18.04 上这样做
我将不胜感激任何帮助!
mikolajbe@mikolajbe-vb:~/freqtrade$ ./setup.sh --install
/usr/bin/python3.6
using Python 3.6
-------------------------
Installing mandatory dependencies
-------------------------
Debian/Ubuntu detected. Setup for this system in-progress
This PPA has been removed from public access as part of a protest against the abuse of open-source projects by large companies. For more detail visit the main page here: https://launchpad.net/~jonathonf
If you are a company and you would like this PPA to continue then let me know your preferred …
Run Code Online (Sandbox Code Playgroud) 当我尝试通过克隆从git安装tensorflow时,我遇到错误"没有名为copyreg的模块",所以我尝试使用virtualenv进行安装.但是,我遇到了这个错误:
pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
tensorflow-0.5.0-py2-none-any.whl is not a supported wheel on this platform.
Run Code Online (Sandbox Code Playgroud)
我没有在常见问题部分看到这一点,所以任何帮助将不胜感激!谢谢.
在SO上,这是一个真正流行的问题,但是我看过的所有答案中,没有一个能清楚地说明此错误的真正含义以及发生的原因。
造成混淆的一个原因是,当您(例如)这样做时pip install pycparser
,您首先会得到以下错误:
Failed building wheel for pycparser
然后出现以下消息,说明该软件包是:
Successfully installed pycparser-2.19
。
# pip3 install pycparser
Collecting pycparser
Using cached https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz
Building wheels for collected packages: pycparser
Running setup.py bdist_wheel for pycparser ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-g_v28hpp/pycparser/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-__w_f6p0 --python-tag cp36:
Traceback (most recent call last):
File "<string>", line 1, in <module>
...
File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2349, in resolve
module = __import__(self.module_name, fromlist=['__name__'], …
Run Code Online (Sandbox Code Playgroud) python-wheel ×10
python ×8
pip ×7
install ×2
python-3.x ×2
setuptools ×2
jpype ×1
numpy ×1
scipy ×1
tensorflow ×1
ubuntu-18.04 ×1
windows ×1