有时无法避免使用的虚拟环境无法使用,但是前期又安装了许多包一个个安装费时费力。采用以下步骤可以便捷的新建一个虚拟环境,将以前虚拟环境中的包快速安装到新环境中。
从开始菜单搜索并打开Anaconda Prompt。在Anaconda Prompt中,激活您的虚拟环境:
conda activate LASimulation
pip freeze > LASimulation_packages.txt
conda create --name qtenv python
conda activate 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