[PYTHON] virtualenvwrapper in windows environment

Python has a very rich library, and you can use commands such as pip and ʻeasy_install` to select the library you want to use. It's easy to install. However, if you install the library without thinking about it, I don't know which library is needed for the program I'm running, It's sad that it works after updating due to a dependency problem between libraries. Fortunately, python has a program to solve this problem, virtualenv, There is a program called virtualenvwrapper that makes it easy to use.

This page introduces how to install and use virtualenvwrapper when running python on windows. Please refer to here for installing python.

install virtualenvwrapper

Start a command prompt and type pip install virtualenvwrapper-win virtualenv and virtualenvwrapper for windows will be installed. スクリーンショット 2015-03-20 17.12.54.png

If you get the following message when you try to execute it, it is possible that the PATH is not in your path or the python library has not been installed properly.

'pip'Is an internal or external command,
It is not recognized as a workable program or batch file.

Creating a new environment

Even if you say to create or switch the environment, you don't know what it is. First, try typing pip freeze at the command prompt. If you just installed it, you'll probably see only two, virtualenv and virtualenvwrapper-win. By the way, the number after == indicates the version number of the library. スクリーンショット 2015-03-20 17.46.58.png

Let's create a new environment. Creating the environment is mkvirtualenv envname. Enter any name you like for * envname *. In the example, it is named myproject. スクリーンショット 2015-03-20 17.13.33.png

When you execute the command, the environment is created and the environment is activated. If the virtual environment is activated, (* envname *) will be displayed on the left side of the usual display of the command prompt.

In the (* myproject *) environment, nothing is displayed even if you type pip freeze because you have not installed any libraries yet. スクリーンショット 2015-03-20 18.01.59.png

In the case of windows (when using virtualenvwrapper-win), a virtual environment is created in the following location. C:\Users\ username \Envs\ envname

How to use summary

command effect Annotation
mkvirtualenv envname Creating a new environment After creating the environment, the environment is activated
workon Environment list display
workon envname envnameActivate your environment
deactivate Get out of the virtual environment Invalid if not in virtual environment

Recommended Posts

virtualenvwrapper in windows environment
Various Anaconda settings in Windows 10 environment
UnicodeDecodeError occurs in pip (Windows environment)
python windows environment
Using venv in Windows + Docker environment [Python]
Set up Pipenv in Pycharm in Windows environment
Building scikit-learn in Windows 10 environment using Pycharm
Python garbled in Windows + Git Bash environment
Prepare Python development environment for each project in Windows environment (VSCode + virtualEnvWrapper + Pylint)
python windows environment construction
Browser specification of Jupyter Notebook in Windows environment
virtual environment in python
Development environment in Python
Execute Language Interpretability Tool (LIT) in Windows 10 environment (1. Environment construction)
How to use jupyter lab in Windows 10 local environment
Until you install TensorFlow-GPU with pip in Windows environment
Force luigi to do parallel processing in windows environment
Use Anaconda in pyenv environment
venv environment with windows powershell
Collaborate in a remote environment
Python environment construction (Windows10 + Emacs)
Handle environment variables in Python
Pip install in proxy environment
Build Python environment on Windows
HTTP environment variables in Flask
Django environment development on Windows 10
Build python environment on windows
Python environment construction under Windows7 environment
(Note) Django in Vagrant environment
[Tensorflow] Tensorflow environment construction on Windows 10
Python install in 2 lines @Windows
I tried the super-resolution algorithm "PULSE" in a Windows environment
How to use VS Code in venv environment on windows
Double-click ipynb in windows + anaconda environment to open with jupyter-notebook
Install Jupiter Notebook on Windows with pip in proxy environment
Create a Python environment for professionals in VS Code on Windows
[Python] Show multiple windows in Tkinter
Python environment construction memo on Windows 10
Run eclipse in Docker environment (noVNC)
Pip install (Windows) under Proxy environment
Hit a command in Python (Windows)
Anaconda python environment construction on Windows 10
Put MeCab in "Windows 10; Python3.5 (64bit)"
(Windows10) Install Linux environment and gnuplot.
Install python2.7 on windows 32bit environment
Install scrapy in python anaconda environment
Environment
Timestamp acquisition command in Unix environment
Morphological analysis of sentences containing recent words in Windows10 64bit environment
[Python3] Development environment construction << Windows edition >>
Windows10: Install MeCab library in python
Create a Linux environment on Windows 10
install tensorflow in anaconda + python3.5 environment
Ml-Agents Release 6 (0.19.0) Environment Construction Summary [Windows]
Use django-debug-toolbar in VirtualBox / Vagrant environment
Bring files in Windows to WSL
Install Python development environment on Windows 10
Error in ordinal number when importing Numpy in Anaconda environment of Windows
Unable to import packages installed in virtual environment with Anaconda on Windows 10
[Memorandum] A story about trying OpenCV tutorial (face recognition) in a Windows environment
[Python] Reason for dtype "int32" in Numpy (Windows environment) (as of September 2020)