小编pra*_*rat的帖子

无法在python中的venv中安装加密==3.4.7

我正在尝试在非互联网机器上安装几个 python 包。出现错误为

Could not find a version that satisfies the requirement cryptography==3.4.7 (from -r requirements.txt (line 14)) (from versions: )
No matching distribution found for cryptography==3.4.7 (from -r requirements.txt (line 14))
Run Code Online (Sandbox Code Playgroud)

我下载了在线系统中的所有软件包,并将requirements.txt软件包文件夹移动并下载到离线系统,并尝试使用以下命令在其中安装软件包,

pip3.6 install --no-index --find-links="./tranferred_packages" -r requirements.txt
Run Code Online (Sandbox Code Playgroud)

我遵循的步骤 -

  1. virtualenv使用pip在线安装:
pip install virtualenv --user

Run Code Online (Sandbox Code Playgroud)
  1. 创建virtualenv并获取它的来源
python -m virtualenv myenv
cd myenv 
source bin/activate
Run Code Online (Sandbox Code Playgroud)
  1. 使用安装的包
pip3 install pkgname
Run Code Online (Sandbox Code Playgroud)
  1. 然后做了
pip freeze > requirements.txt
Run Code Online (Sandbox Code Playgroud)
  1. 使用以下命令将 pkgs 下载到一个文件夹
pip download -r requirements.txt
Run Code Online (Sandbox Code Playgroud)
  1. 将 pkgs 文件夹移动requirements.txt …

python pip virtualenv python-3.x

4
推荐指数
1
解决办法
5612
查看次数

标签 统计

pip ×1

python ×1

python-3.x ×1

virtualenv ×1