无法在Windows 10和python 37中创建并激活Virtualenv

时间:2019-02-07 14:51:43

标签: python django virtualenv

我是Python的新手,并且是一名编码人员:)我正在尝试创建并激活virtualenv,花了几天的时间来解决此问题,但我不能,您能帮我吗。

谢谢。

让我告诉您我的管理员:

Using base prefix 'c:\\users\\büşra\\appdata\\local\\programs\\python\\python37'
New python executable in C:\Users\Büşra\Desktop\Django-Virtualenv\myenv\Scripts\python.exe
Complete output from command C:\Users\Büşra\Deskt...v\Scripts\python.exe -m pip config list:
Could not import runpy module
ModuleNotFoundError: No module named 'runpy'
----------------------------------------
Traceback (most recent call last):
  File "c:\users\büşra\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\büşra\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Büşra\AppData\Local\Programs\Python\Python37\Scripts\virtualenv.exe\__main__.py", line 9, in <module>
  File "c:\users\büşra\appdata\local\programs\python\python37\lib\site-packages\virtualenv.py", line 793, in main
    symlink=options.symlink,
  File "c:\users\büşra\appdata\local\programs\python\python37\lib\site-packages\virtualenv.py", line 1087, in create_environment
    install_wheel(to_install, py_executable, search_dirs, download=download)
  File "c:\users\büşra\appdata\local\programs\python\python37\lib\site-packages\virtualenv.py", line 935, in install_wheel
    _install_wheel_with_search_dir(download, project_names, py_executable, search_dirs)
  File "c:\users\büşra\appdata\local\programs\python\python37\lib\site-packages\virtualenv.py", line 964, in _install_wheel_with_search_dir
    config = _pip_config(py_executable, python_path)
  File "c:\users\büşra\appdata\local\programs\python\python37\lib\site-packages\virtualenv.py", line 1038, in _pip_config
    remove_from_env=["PIP_VERBOSE", "PIP_QUIET"],
  File "c:\users\büşra\appdata\local\programs\python\python37\lib\site-packages\virtualenv.py", line 886, in call_subprocess
    raise OSError("Command {} failed with error code {}".format(cmd_desc, proc.returncode))
OSError: Command C:\Users\Büşra\Deskt...v\Scripts\python.exe -m pip config list failed with error code 1```

1 个答案:

答案 0 :(得分:0)

在Windows计算机上,您将按以下方式激活虚拟环境: cd进入项目目录,如果您的虚拟环境名为venv,则此 venv \ scripts \ activate将激活虚拟环境