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


    前言

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

    步骤

    1. 打开Anaconda Prompt:

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

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

    以上步骤将帮助您在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
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    更换源

    pip install pyarmor -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
    
    • 1
  • 相关阅读:
    淘宝关键词搜索商品API
    【深度学习笔记】6_5 RNN的pytorch实现
    【Python 零基础入门】变量 & 数据类型
    O2O优惠券预测
    美团2024届秋招笔试第一场编程【小美走公路】
    C++ STL详解(五) -------- priority_queue
    数学建模学习(73):用Python敏感性分析,如此轻松简单
    SOC设计:关于时钟门控的细节
    Redis的主从复制
    一文读懂SQL中的Aggregate(聚合) 函数和Scalar(标准)函数
  • 原文地址:https://blog.csdn.net/wokaowokaowokao12345/article/details/134325884