使用pip3软件包下载另一个Python版本 [英] download with pip3 packages for another python release
问题描述
我拥有一个离网服务器(带有python3.8的Linux x86_64),我想在其上安装pypi软件包.到目前为止,我从pypi.org手动下载了每个软件包和依赖项.而且很痛苦.
I own an off grid server (linux x86_64 with python3.8) on which I would like to install pypi packages. Up to now, I download manually each package and dependencies from pypi.org. And it is painful.
我想使用 pip3下载
功能,该功能非常适合我的需求!除了我从中下载的平台有很大不同(带有python3.6的win_amd64).由于我想获取 numpy-1.18.5-cp38-cp38-manylinux1_x86_64.whl
,因此我尝试了:
I would like to use pip3 download
feature which is perfect for my needs ! Except the platform I download from is very different (win_amd64 with python3.6). Since I want to get numpy-1.18.5-cp38-cp38-manylinux1_x86_64.whl
, I tried :
pip3 download --verbose --only-binary=:all: --abi=cp38 --platform=manylinux1_x86_64 numpy
然后,检查详细日志,找到与预期车轮相对应的行,我得到一个与该Python不兼容
...当然不是!
And, checking the verbose log, for the line which correspond to the expected wheel, I get a it is not compatible with this Python
... Of course it isn't !
即使不是我所下载平台的正确文件,我如何强制pip3下载适当的 .whl
文件?
How could I force pip3 to download the appropriate .whl
file even if it is not the correct one for the platform I download it from ?
推荐答案
如果要传递-abi
,则还必须传递-python-version
,因此 pip
可以构建正确的平台标记.这应该有效(未试用):
If you're passing --abi
, you have to also pass the --python-version
so pip
can build the correct platform tag. This should work (untested):
$ pip3 download --only-binary=:all: --python-version=38 --abi=cp38 --platform=manylinux1_x86_64 numpy
尽管承认, pip下载
并非可靠,例如解决环境标记和内容时.
Although admitted, pip download
is anything but reliable, e.g. when it comes to resolving environment markers and stuff.
这篇关于使用pip3软件包下载另一个Python版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!