安装 python wheel 文件,“*.whl”会导致“...在此平台上不受支持的 wheel”
Installing a python wheel file, '*.whl" results in " ... is not a supported wheel on this platform"
我在 Mac OSX 10.9.5 上安装了 Anaconda 运行 Python 2.7.10。我正在尝试安装一个名为 "Fiona" 的包。
我输入了:
sudo pip install Fiona-1.6.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
结果:
The directory '/Users/ronaldbjork/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Fiona-1.6.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl **is not a supported wheel on this platform.**
建议使用-H:
所以我输入了:
sudo -H pip install Fiona-1.6.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
结果:
Fiona-1.6.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl **is not a supported wheel on this platform**
Python wheels 是一种分发二进制包的方式。
项目的维护者在每个支持的平台(例如 Windows、Mac、linux, etc) 然后直接用编译后的二进制代码发送包。
优点是在安装包的时候,只要wheel是在同一个平台上编译的,所有安装只需要解压一个tar文件然后whala,包就安装好了。很酷。这对具有大量 C 代码的相当大的包尤其有显着影响,例如 numpy
:
(test) ❯❯❯ time pip install numpy
Collecting numpy
Using cached numpy-1.9.2-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Installing collected packages: numpy
Successfully installed numpy-1.9.2
2.50 real 1.37 user 0.38 sys
如您所见,numpy
安装时间为 2.5 秒!!!如果您曾经从源代码安装过它,那真是太疯狂了!
无论如何,回到你的问题。所以你得到 ... is not a supported wheel on this platform
的原因是因为你安装的包不是在你安装它的同一平台上编译的,因此你不能从 wheel 安装,需要从源代码安装,这将在安装时编译代码时间.
只要你有一个最近的 pip,你应该能够简单地做:
pip install Fiona==1.6.0
如果可以,它将使用 wheel,如果不能使用 wheel,则从源安装。
为什么要费心轮包。您说您拥有 python 的 Anaconda 发行版,快速查看 included packages 表明 Fiona 已经存在。您可以简单地:
conda install fiona
这允许 conda 安装程序管理所有二进制依赖项。也让升级更容易。您还可以通过 conda search fiona
查看更完整的可用版本列表,或查看 anaconda.org(以前称为 binstar.org)上可用的软件包。
编辑: 我从您上面的评论中看到这与 GeoPandas 的兼容性问题有关。虽然不是 Anaconda 的一部分,但快速搜索显示了一些贡献 packages on anaconda.org including this one from IOOS 贡献
conda install -c https://conda.anaconda.org/ioos geopandas
底线:安装 Anaconda 后,我会说总是尝试 conda install
并在尝试 pip 之前先搜索 anaconda.org。
我在 Mac OSX 10.9.5 上安装了 Anaconda 运行 Python 2.7.10。我正在尝试安装一个名为 "Fiona" 的包。
我输入了:
sudo pip install Fiona-1.6.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
结果:
The directory '/Users/ronaldbjork/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Fiona-1.6.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl **is not a supported wheel on this platform.**
建议使用-H:
所以我输入了:
sudo -H pip install Fiona-1.6.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
结果:
Fiona-1.6.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl **is not a supported wheel on this platform**
Python wheels 是一种分发二进制包的方式。
项目的维护者在每个支持的平台(例如 Windows、Mac、linux, etc) 然后直接用编译后的二进制代码发送包。
优点是在安装包的时候,只要wheel是在同一个平台上编译的,所有安装只需要解压一个tar文件然后whala,包就安装好了。很酷。这对具有大量 C 代码的相当大的包尤其有显着影响,例如 numpy
:
(test) ❯❯❯ time pip install numpy
Collecting numpy
Using cached numpy-1.9.2-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Installing collected packages: numpy
Successfully installed numpy-1.9.2
2.50 real 1.37 user 0.38 sys
如您所见,numpy
安装时间为 2.5 秒!!!如果您曾经从源代码安装过它,那真是太疯狂了!
无论如何,回到你的问题。所以你得到 ... is not a supported wheel on this platform
的原因是因为你安装的包不是在你安装它的同一平台上编译的,因此你不能从 wheel 安装,需要从源代码安装,这将在安装时编译代码时间.
只要你有一个最近的 pip,你应该能够简单地做:
pip install Fiona==1.6.0
如果可以,它将使用 wheel,如果不能使用 wheel,则从源安装。
为什么要费心轮包。您说您拥有 python 的 Anaconda 发行版,快速查看 included packages 表明 Fiona 已经存在。您可以简单地:
conda install fiona
这允许 conda 安装程序管理所有二进制依赖项。也让升级更容易。您还可以通过 conda search fiona
查看更完整的可用版本列表,或查看 anaconda.org(以前称为 binstar.org)上可用的软件包。
编辑: 我从您上面的评论中看到这与 GeoPandas 的兼容性问题有关。虽然不是 Anaconda 的一部分,但快速搜索显示了一些贡献 packages on anaconda.org including this one from IOOS 贡献
conda install -c https://conda.anaconda.org/ioos geopandas
底线:安装 Anaconda 后,我会说总是尝试 conda install
并在尝试 pip 之前先搜索 anaconda.org。