Anaconda 快速将某个虚拟环境A中的包在另一个虚拟环境B中安装

前言

有时无法避免使用的虚拟环境无法使用,但是前期又安装了许多包一个个安装费时费力。采用以下步骤可以便捷的新建一个虚拟环境,将以前虚拟环境中的包快速安装到新环境中。

步骤

  1. 打开Anaconda Prompt:

从开始菜单搜索并打开Anaconda Prompt。在Anaconda Prompt中,激活您的虚拟环境:

conda activate LASimulation
  1. 然后导出包列表到一个文件:
pip freeze > LASimulation_packages.txt
  1. 创建新的虚拟环境qtenv:
conda create --name qtenv python
  1. 激活新的qtenv虚拟环境:
conda activate qtenv
  1. 安装LASimulation_packages.txt中的包到qtenv环境:
pip install -r LASimulation_packages.txt

以上步骤将帮助您在Windows系统的Anaconda环境中复制一个虚拟环境。这里pip freeze命令导出的是使用pip安装的包,而conda list --export命令则会导出使用conda安装的包。如果您同时使用了conda和pip来管理包,您可能需要分别导出两个列表,并在新环境中相应地使用conda install和pip install来安装它们。

各类问题汇总

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)'))': /simple/bista/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)'))': /simple/bista/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)'))': /simple/bista/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)'))': /simple/bista/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)'))': /simple/bista/
Could not fetch URL https://pypi.org/simple/bista/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/bista/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)'))) - skipping
ERROR: Could not find a version that satisfies the requirement bista (from versions: none)
ERROR: No matching distribution found for bista

更换源

pip install pyarmor -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
  • 1
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值