简体   繁体   中英

creating python virtual environment on windows 7

I wanted to create a python virtual environment in Windows 7. I have installed activepython 2.7 32 bit version and installed virtualev using pip command. After that I created a folder named "virtualenv", on drive C. For that folder I have executed the following command.

virtualenv <virtualenv-name>

While executing this command it opens a python file named virtualenv.py . While closing the file, it does not prompt to be saved.

While checking on C:\\virtualenv\\ I was not getting the virtual environment that I tried to create.

From command line execute:

virtualenv MY_ENV

It will create a virtual env in MY_ENV folder. Than activate it:

MY_ENV\Scripts\activate

Also check the virtualenv user guide .

conda create --name myvirtualenv python=2.7 numpy

这将创建一个 python 2.7 的虚拟环境,仅包含 numpy 或 pandas 或基于参数的完整包

First, open cmd and go to the directory where you want your virtual env to be present. while writing this I have 3.7.5 python installed on my PC. write below command on cmd. py -m venv. for activation of the virtual environment. open Scripts folder and click on activate file, for reference visit this website https://docs.python.org/3/library/venv.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM