2017-10-23 13 views
0

Windows 10 명령 프롬프트를 사용하여 가상 환경을 만들고 활성화하려고합니다. virtualenv가 명령으로 올바르게 설치되었음을 압니다.Windows 10 명령 프롬프트에서 가상 환경을 활성화하는 방법은 무엇입니까?

virtualenv venv 

작동. my virtualenv 다운로드, Downloads \ venv \ Scripts로 이동하여 가상 환경 venv를 활성화하려고합니다. 시도했습니다.

venv activate 

Windows가 venv를 명령으로 인식하지 못하기 때문에 작동하지 않습니다. 나는 또한 시도했다

virtualenv가 "venv activate"는 유효한 인수가 아니기 때문에 작동하지 않는다.

+0

이 대답은 https://stackoverflow.com/questions/4527958/python-virtualenv-questions 도움이 될 수 있습니다 – TylerH

답변

1

당신이 virtualenvwrapper-win을 사용하고 (PowerShell을 예 반대) DOS 명령 프롬프트를 사용하는 경우, 다음 새 virtualenvs 사용하여 작성됩니다

mkvirtualenv myenv 

workon myenv 

당신을 사용하여 활성화 virtualenvs가 상주 할 위치를 가리 키도록 환경 변수 WORKON_HOME을 정의해야합니다.

virtualenvwrapper-win>=1.2.4을 설치 한 경우 다음 virtualenvwrapper 명령은 당신에게 목록을 제공합니다 사용할 수있는 명령 :

go|c:\srv> virtualenvwrapper 

virtualenvwrapper is a set of extensions to Ian Bicking's virtualenv 
tool. The extensions include wrappers for creating and deleting 
virtual environments and otherwise managing your development workflow, 
making it easier to work on more than one project at a time without 
introducing conflicts in their dependencies. 

virtualenvwrapper-win is a port of Dough Hellman's virtualenvwrapper to Windows 
batch scripts. 

Commands available: 

    add2virtualenv: add directory to the import path 

    cdproject: change directory to the active project 

    cdsitepackages: change to the site-packages directory 

    cdvirtualenv: change to the $VIRTUAL_ENV directory 

    lssitepackages: list contents of the site-packages directory 

    lsvirtualenv: list virtualenvs 

    mkproject: create a new project directory and its associated virtualenv 

    mkvirtualenv: Create a new virtualenv in $WORKON_HOME 

    rmvirtualenv: Remove a virtualenv 

    setprojectdir: associate a project directory with a virtualenv 
    toggleglobalsitepackages: turn access to global site-packages on/off 

    virtualenvwrapper: show this help message 

    whereis: return full path to executable on path. 

    workon: list or change working virtualenvs