我正在尝试用VS代码制作一个虚拟视频。我首先安装了virtualenv
PS C:\Users\to\folder> pip3 install virtualenv
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in
Python is not available.
Requirement already satisfied: virtualenv in f:\anaconda\lib\site-packages (20.4.7)
Requirement already satisfied: distlib<1,>=0.3.1 in f:\anaconda\lib\site-packages (from virtualenv) (0.3.2)
Requirement already satisfied: six<2,>=1.9.0 in f:\anaconda\lib\site-packages (from virtualenv) (1.15.0)
Requirement already satisfied: filelock<4,>=3.0.0 in f:\anaconda\lib\site-packages (from virtualenv) (3.0.12)
Requirement already satisfied: appdirs<2,>=1.4.3 in f:\anaconda\lib\site-packages (from virtualenv) (1.4.4)
这个输出与我根据指南所期望的不同。然后当我尝试创建一个虚拟环境时这就是我得到的
PS C:\Users\to\folder> virtualenv env
Traceback (most recent call last):
File "f:\anaconda\lib\runpy.py", line 194, in _run_module_as_mainreturn _run_code(code, main_globals, None,
File "f:\anaconda\lib\runpy.py", line 87, in _run_codeexec(code, run_globals)
File "F:\Anaconda\Scripts\virtualenv.exe\__main__.py", line 4, in <module>
File "f:\anaconda\lib\site-packages\virtualenv\__init__.py", line 3, in <module>from .run import cli_run, session_via_cli
File "f:\anaconda\lib\site-packages\virtualenv\run\__init__.py", line 11, in <module>from ..seed.wheels.periodic_update import manual_upgrade
File "f:\anaconda\lib\site-packages\virtualenv\seed\wheels\__init__.py", line 3, in <module>from .acquire import get_wheel, pip_wheel_env_run
File "f:\anaconda\lib\site-packages\virtualenv\seed\wheels\acquire.py", line 12, in <module>from .bundle import from_bundle
File "f:\anaconda\lib\site-packages\virtualenv\seed\wheels\bundle.py", line 4, in <module>from .periodic_update import periodic_update
File "f:\anaconda\lib\site-packages\virtualenv\seed\wheels\periodic_update.py", line 10, in <module>
import ssl
File "f:\anaconda\lib\ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: DLL load failed while importing _ssl: The specified module could not be found.
我还没有以anaconda的形式推出VS代码,但它似乎正在研究anaconda的包来制作虚拟环境。
似乎您正试图在Anaconda中安装virtualenv
。这是不必要的,因为Anaconda本身就是一个环境管理器。看看这些答案
关于错误本身,我相信它,因为你没有激活你的蟒蛇环境。看看这个问题。我的解决方案通常是在Anaconda提示符中键入code
,以启动VS代码。