[PYTHON] Add System to pyenv-win versions

0. Introduction

Pyenv that manages the Python version. Mac and Linux have a path to call the conventional Python version as System, but Windows does not. I searched many sites such as Qiita but did not find it, so here is a summary of how to add the conventional Python path as System to Windows versions. Click here for the video commentary.

1. Symbolic link

Symbolic links refer to directories and are similar to shortcuts. The difference between them is whether the type is a folder or a shortcut. I created a folder shortcut for Python in versions, but I couldn't load it. Perhaps the pyenv command versions only recognizes folders. A symbolic link is created by hitting the following with a command prompt opened with administrator privileges.

cmd.exe


mklink /D <The path of the directory to create> <Existing directory path>

2. Added as System

Let's add it immediately. Type the following with a command prompt opened with administrator privileges.

cmd.exe


mklink /D C:\Users\mai\.pyenv\pyenv-win\versions\System C:\Users\mai\AppData\Local\Programs\Python

If you haven't changed the installation location of Python or pyenv-win, it will be the same path as mine. If you check with versions, System will be displayed in the same way as the installed version. The rest is the same as the version change

cmd.exe


pyenv global System

If you hit, it will be the conventional Python version.

3. Finally

In this way, the added System and traditional Python are in sync. Therefore, it is necessary to note that the library installed under the pyenv environment remains even when the pyenv environment is deleted and the original Python is restored.

Recommended Posts

Add System to pyenv-win versions
Add convolution to MNIST
Add / remove kernel to JupyterLab
Add a dictionary to MeCab
Add page number to PDF
Add user dictionary to MeCab
To add a C module to MicroPython ...
Add cumulative ratio to matplotlib histogram
Add Python 2.7 Japanese documentation to Dash.app
How to add sudo when debugging
Introduction to regular expression processing system
How to add AWS EBS volume
Add TRACE log level to Python ...?
Add SSH connectable users to EC2
[Introduction to Python3 Day 21] Chapter 10 System (10.1 to 10.5)