使用Pyhton 3在Windows中创建虚拟环境

时间:2019-08-01 10:25:42

标签: python virtualenv virtual environment

在Windows 7中的Python 3.73上创建虚拟环境时出现错误。

在创建新的虚拟环境期间,出现如下错误。

有人可以帮我这个忙吗?我已经搜索了很多信息,没有任何帮助。

预先感谢

Using base prefix 'C:\\Users\\Саша\\AppData\\Local\\Programs\\Python\\Python37-32'
New python executable in C:\Users\Саша\myenv\Scripts\python.exe
Command C:\Users\Саша\myenv\Scripts\python.exe -m pip config list had error code 1
Installing setuptools, pip, wheel...

  Complete output from command C:\Users\Саша\myenv\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\Python37-32\lib\runpy.py", line 193, in _run_module_as
    "__main__", mod_spec)
  File "C:\Users\Саша\AppData\Local\Programs\Python\Python37-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Саша\AppData\Roaming\Python\Python37\site-packages\virtualenv.py", line 2635, in <module>
    main()
  File "C:\Users\Саша\AppData\Roaming\Python\Python37\site-packages\virtualenv.py", line 870, in main
    symlink=options.symlink,
  File "C:\Users\Саша\AppData\Roaming\Python\Python37\site-packages\virtualenv.py", line 1173, in create_e
    install_wheel(to_install, py_executable, search_dirs, download=download)
  File "C:\Users\Саша\AppData\Roaming\Python\Python37\site-packages\virtualenv.py", line 1019, in install_
    _install_wheel_with_search_dir(download, project_names, py_executable, search_dirs)
  File "C:\Users\Саша\AppData\Roaming\Python\Python37\site-packages\virtualenv.py", line 1110, in _install
arch_dir
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=script)
  File "C:\Users\Саша\AppData\Roaming\Python\Python37\site-packages\virtualenv.py", line 963, in call_subp
    raise OSError("Command {} failed with error code {}".format(cmd_desc, proc.returncode))
OSError: Command C:\Users\Саша\myenv\Scripts\python.exe - setuptools pip wheel failed with error code 1

1 个答案:

答案 0 :(得分:0)

尝试删除python to 'c:\python37' from appdata。因为您的路径名中包含Unicode字符。