[PYTHON] Check when the version does not switch with pyenv

Work memo

I will summarize how to isolate the problem when installing pyenv Please refer to the official materials as much as possible to install. Official: https://github.com/pyenv/pyenv#installation

Check which python you are using

Judge whether it is "python set by pyenv" or "python installed by default in the OS"

#mac default python
$ which python
/usr/bin/python

#pyenv python
$ which python
/Users/xxxx/.pyenv/shims/python

Check the shell config file

Check which shell

In shell, I need to read the environment variables of pyenv Check because the location to load the environment variable of pyenv differs depending on the shell.

$ echo $SHELL
/bin/zsh

The description method is described in the official 2. Define environment variable PYENV_ROOT ... Since the description method is different for each shell, the explanation is omitted. https://github.com/pyenv/pyenv#basic-github-checkout

I set an environment variable but it doesn't work

It may work normally by refreshing the settings of shell and pyenv.

//Refresh shell settings
$ exec "$SHELL"
//Refresh pyenv settings
$ pyenv rehash

Official is the best

Finally, in this qiita, we summarized how to isolate the problem. I think that the installation method is "it's okay if you look at the official b", but I think that you may stumble at the first setting, so I want to be an engineer who can isolate the problem at that time. Official: https://github.com/pyenv/pyenv#installation

Recommended Posts

Check when the version does not switch with pyenv
Python version does not switch
Do not switch with pyenv global!
Check when the Docker container does not connect to the Internet
What to do if Python does not switch from the System version in pyenv
Check items when the imported python module does not work as expected
When wildcard specification does not work with pylint
Check version with python
Examples and solutions that the Python version specified in pyenv does not run
Solution when Linux does not recognize the built-in camera
Chrome cannot be opened with selenium because the version of Chrome driver does not match
Check the code with flake8
Raise the version of pyenv itself
Check the behavior when assigning Python
Easily switch pyenv virtualenvs with peco
Solution when background-cover of Linux version VS Code does not work
Tkinter canvas (window) does not start when running Python 3.7.4 with Atom
Calling time.sleep () after the print function with the argument end does not print
When the program pip installed on Mac / Marvericks does not work
Check points when MIDI does not work in a program using SDL_mixer
What to do if pyenv install does not proceed with an error
Processing when the key input of Python pygame does not go well.
How to check the version of Django
Check the existence of the file with python
When Anaconda Navigator (Mac) does not start
When cv2.VideCapture (aviname) does not read well
Install by specifying the version with pip
Python> Python does not include the last offset
SciPy version does not go up (Mac)
When changing the table name with flask_migrate
Check the file size with du -sh *
[https proxy with squid] Eliminate the error when accessing the web server that does not chain the intermediate CA certificate.
Example of what to do when the sample script does not work (OpenCV-Python)
It seems that the version of pyflakes is not the latest when flake8 is installed
About the problem that the python version of Google App Engine does not mesh
Ubuntu 16.04 LTS, beginner memorandum of environment construction to switch anaconda version with pyenv
Solution to the problem that build does not end when installing OpenCV (PEP517)
When the log acquired by rsyslog is not updated after rotation with logrotate
Notify slack when the switch sales page is updated ~ slack bot development with python ③ ~
What to do when the graph does not appear in jupyter (ipython) notebook
Check the date of the flag duty with Python
GAE forbidden: The caller does not have permission
After installing php7.2, the php command does not work
Get the latest Linux kernel version with Arch Linux
[Python] Expression (1,2) does not make tuples with parentheses
Spider not found appears when crawling with Scrapy
Investigate the cause when an error is thrown when python3.8 is not found when using lambda-uploader with python3.8
[systemd] How to deal with the problem that fancontrol does not work after suspending
Solved the problem that the image was not displayed in ROMol when loaded with PandasTools.LoadSDF.
A command to check when something goes wrong when the server is not doing anything
Addresses an issue where an error does not occur even if the path does not pass when trying to read an image with cv2.imread ()