无法在win10上成功运行virtualenv

时间:2017-04-09 10:06:17

标签: python-3.x virtualenv

我使用python36和win10,我可以成功安装virtualenv。但是当我想激活它时,发生了一些错误。

$pip install virtualenv
Requirement already satisfied: virtualenv in c:\users\appdata\local\programs\python\python36\lib\site-packages
$virtualenv venv
Using base prefix 'c:\\users\\appdata\\local\\programs\\python\\python36'
New python executable in C:\Users\myvenv\venv\Scripts\python.exe
Installing setuptools, pip, wheel...
  Complete output from command C:\Users\myvenv\venv\Scripts\python.exe - setuptools pip wheel:
  Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
ModuleNotFoundError: No module named 'pkgutil'
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
  File "c:\users\appdata\local\programs\python\python36\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
  File "c:\users\appdata\local\programs\python\python36\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "C:\Users\AppData\Local\Programs\Python\Python36\Scripts\virtualenv.exe\__main__.py", line 9, in <module>
  File "c:\users\appdata\local\programs\python\python36\lib\site-packages\virtualenv.py", line 713, in main
symlink=options.symlink)
  File "c:\users\appdata\local\programs\python\python36\lib\site-packages\virtualenv.py", line 945, in create_environment
download=download,
  File "c:\users\appdata\local\programs\python\python36\lib\site-packages\virtualenv.py", line 901, in install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
  File "c:\users\appdata\local\programs\python\python36\lib\site-packages\virtualenv.py", line 797, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command C:\Users\myvenv\venv\Scripts\python.exe - setuptools pip wheel failed with error code 1

为什么会出现这样的问题?

1 个答案:

答案 0 :(得分:0)

事实上,您不需要重新安装python,而只需在cmd行中输入virtualenv envname --no-setuptools --no-pip --no-wheel,希望对您有帮助。