Creating a python virtual environment on Windows

Create a virtual environment on Windows without using Anaconda.

environment

Windows10 home 64bit python:3.7.9


① Install python on Windows

Official Python site Official Site

The Microsoft Store also has python, which makes it easy to install. Since it is easy to specify the detailed version, select the basic formula.

  1. Click Downloads スクリーンショット (316).png

  2. Select the Ver you want to use スクリーンショット (317).png

  3. Select Windows x86-64 executable installer スクリーンショット (319).png After that, click the downloaded exe file to install it.

When you start the installation by checking "App Python *. * To PATH" on the installation start screen PATH is automatically added to the environment variable.

After the installation is complete, launch the Windows command prompt Type python at the prompt and it's OK if python starts

スクリーンショット (324).png

This completes the installation of python on windows.


② Software installation

Install the software related that you have been using through Anaconda.

#Jupyter Lab
pip install jupyterlab

#Jupyter Notebook
pip install Jupyter

#Spyder
pip install spyder

No need to install everything separately. If you use VScode, there is no problem even if you do not put it separately.

#Jupyter Lab
jupyter lab

#Jupyter Notebook
jupyter notebook

#Spyder
spyder

Now each app can be started without going through Anaconda.


③ Virtual environment construction

Ipython kernel installation

pip install ipykernel

Create a virtual environment

python -m venv .test

Entering this command will create a folder for the virtual environment.

Please set the folder name as you like.

In the above method, the folder will appear under C drive → User → User. (My situation) スクリーンショット (326).png

The contents of the folder スクリーンショット (329).png

Enter the created virtual environment

C:Users \ username>.test¥Scripts¥activate
   ↓
(.test)C:Users \ username>

Install the modules you want to use in the virtual environment.

Example)
pip install numpy

Build your own environment.

Virtual environment settings

ipython kernel install --user --name=test

The virtual environment created with this can be selected in Jupyter Lab and Jupyter Notebook.

You can exit from the virtual environment with deactivate.


④ Summary

If you use pip after installing python, you may get an alarm that Ver is old. In that case, because the installation command is in the alarm If you enter it exactly, it will be updated.

that's all.

Recommended Posts

Creating a python virtual environment on Windows
Create a Python virtual development environment on Windows
Ubuntu18.04.05 Creating a python virtual environment in LTS
Simply build a Python 3 execution environment on Windows
Build Python environment on Windows
Building a Python virtual environment
[Venv] Create a python virtual environment on Ubuntu
Build python environment on windows
Building a Python virtual environment
Steps to create a Python virtual environment with VS Code on Windows
Build a GVim-based Python development environment on Windows 10 (3) GVim8.0 & Python3.6
Python: Creating a virtual environment (venv), starting and stopping
Notes on creating a python development environment on macOS Catalina
Build a GVim-based Python development environment on Windows 10 (1) Installation
Procedure for building a CDK environment on Windows (Python)
Create a decent shell and python environment on Windows
Notes on creating a virtual environment with Anaconda Navigator
Building a Python environment on Mac
Python environment construction memo on Windows 10
Anaconda python environment construction on Windows 10
Building a Python environment on Ubuntu
Install python2.7 on windows 32bit environment
Create a Python environment on Mac (2017/4)
Create a virtual environment with Python!
Building a virtual environment with Python 3
Create a Linux environment on Windows 10
Create a python environment on centos
Install Python development environment on Windows 10
Build a python3 environment on CentOS7
Python on Windows
python windows environment
How to build a new python virtual environment on Ubuntu
Build a GVim-based Python development environment on Windows 10 (2) Basic settings
Create a virtual environment for python on mac [Very easy]
Python 2.7, 3.4, 3.5 extension module build environment on Windows
Build a python environment on MacOS (Catallina)
Python virtual environment and packages on Ubuntu
Create a python environment on your Mac
Let's create a virtual environment for Python
[Python] Create a virtual environment with Anaconda
Building a Python 3.6 environment with Windows + PowerShell
I built a TensorFlow environment on windows10
Create a Linux virtual machine on Windows
Build a python virtual environment with pyenv
Build a Python + OpenCV environment on Cloud9
Creating a virtual environment in an Anaconda environment
Add a Python virtual environment to VSCode
Create a Python environment for professionals in VS Code on Windows
Build a 64-bit Python 2.7 environment with TDM-GCC and MinGW-w64 on Windows 7
Everything from building a Python environment to running it on Windows
python windows environment construction
python virtual environment Pipenv
python basic on windows ②
Install python on windows
virtual environment in python
Create a Python environment
Virtual environment with Python 3.6
How to create a Python virtual environment (venv)
A tool for creating symbolic links on Windows
Build a python environment with ansible on centos6
Build a Python environment on Mac (Mountain Lion)