如何安装带有 .whl 文件的 Python 包? [英] How do I install a Python package with a .whl file?

查看:30
本文介绍了如何安装带有 .whl 文件的 Python 包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 Windows 机器上安装 Python 包时遇到问题,我想用 Christoph Gohlke 的 Window 二进制文件安装它.(根据我的经验,这减轻了许多其他软件包安装的麻烦).但是,只有 .whl 文件可用.

I'm having trouble installing a Python package on my Windows machine, and would like to install it with Christoph Gohlke's Window binaries. (Which, to my experience, alleviated much of the fuss for many other package installations). However, only .whl files are available.

http://www.lfd.uci.edu/~gohlke/pythonlibs/#jpype

但我如何安装 .whl 文件?

But how do I install .whl files?

  • I've found documents on wheel, but they don't seem so staightforward in explaining how to install .whl files.
  • This question is a duplicate with this question, which wasn't directly answered.

推荐答案

我只使用了以下很简单的方案.首先打开一个控制台,然后 cd 到你下载文件的地方,比如 some-package.whl 并使用

I just used the following which was quite simple. First open a console then cd to where you've downloaded your file like some-package.whl and use

pip install some-package.whl

注意:如果 pip.exe 无法识别,您可能会在安装 python 的Scripts"目录中找到它.如果未安装 pip,此页面可以提供帮助:如何在 Windows 上安装 pip?

Note: if pip.exe is not recognized, you may find it in the "Scripts" directory from where python has been installed. If pip is not installed, this page can help: How do I install pip on Windows?

注意:为了澄清
如果您将 *.whl 文件复制到本地驱动器(例如 C:some-dirsome-file.whl),请使用以下命令行参数 --

Note: for clarification
If you copy the *.whl file to your local drive (ex. C:some-dirsome-file.whl) use the following command line parameters --

pip install C:/some-dir/some-file.whl

这篇关于如何安装带有 .whl 文件的 Python 包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆