Create a virtual environment on Windows without using Anaconda.
Windows10 home 64bit python:3.7.9
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.
Click Downloads
Select the Ver you want to use
Select Windows x86-64 executable installer 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
This completes the installation of python on windows.
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.
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)
The contents of the folder
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
.
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