• 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
  • 相关阅读:
    设计模式 — — 单例模式
    nginx rewrite(重定向)
    tomcat9乱码处理
    LeetCode 91 双周赛
    React + hooks + Ts 实现将后端响应的文件流(如Pdf)输出到浏览器下载
    8条IM即时通讯开发iOS端移动网络调优建议
    Java复习六:内部类+异常处理
    蛋白结构评价-LDDT score
    物联网 嵌入式 单片机 毕设如何选题 【项目分享】
    VM安装Windows虚拟机
  • 原文地址:https://blog.csdn.net/wokaowokaowokao12345/article/details/134325884