I raised the Python version from 2 to 3, but every time I restart the ubuntu terminal, the version remains 2.

Current status

I used pyenv to update python from 2 to 3.

After that, the Path was set with the following command.

$ export PATH="/home/{{user name}}/.pyenv/bin:$PATH"
$ eval "$(pyenv init -)"
$ eval "$(pyenv virtualenv-init -)"
$ python --version
Python 3.7.6

However, if I erase the terminal that is currently open and restart it,

$ python --version
Python 2.7.6

And the python version has returned to 2.

solution

** Edit /.bashrc to run commands automatically on reboot **

$ vi ~/.bashrc

Open the bashrc file and edit it.

In any place,

export PATH="/home/{{user name}}/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

If you add ok

Recommended Posts

I raised the Python version from 2 to 3, but every time I restart the ubuntu terminal, the version remains 2.
I tried to display the video playback time (OpenCV: Python version)
I wanted to use the Python library from MATLAB
I want to restart CentOS 8 on time every day.
I read the Chainer reference (updated from time to time)
I tweeted from the terminal!
I tried changing the python script from 2.7.11 to 3.6.0 on windows10
I want to use the Ubuntu desktop environment on Android for the time being (Termux version)
How to get the Python version
I made something with python that NOW LOADING moves from left to right on the terminal
Python (from first time to execution)
Terminal association from the server side to Amazon SNS (python + boto3)
Change the active version in Pyenv from anaconda to plain Python
I was able to print the thermal printer "PAPERANG" from Python (Windows10, Python3.6)
[Python] Warning came out when I raised from Selenium 3 to 4 [Web Driver]
For the first time in Numpy, I will update it from time to time
Python: I want to measure the processing time of a function neatly
Private Python handbook (updated from time to time)
I want to use jar from python
I just want to add scipy, but it's a messy note. Ubuntu, Python 3.
Python version (PHP to Python) that deletes the subsequent character string from the specified character string (extension)
[IBM Cloud] I tried to access the Db2 on Cloud table from Cloud Funtions (python)
[Python] I tried to get the type name as a string from the type function
I wanted to create a dll to use a function written in C from Python with ctypes, but I had a hard time
I want to email from Gmail using Python.
[Python] I want to manage 7DaysToDie from Discord! 1/3
I tried python programming for the first time.
Try the free version of Progate [Python I]
How to measure line speed from the terminal
I want to use ceres solver from python
What I did when updating from Python 2.6 to 2.7
At the time of python update on ubuntu
[Python] I want to manage 7DaysToDie from Discord! 2/3
I want to make C ++ code from Python code!
[Python] I will upload the FTP to the FTP server.
progate Python learning memo (updated from time to time)
I want to display the progress in Python!
[Python] I made a system to introduce "recipes I really want" from the recipe site!
I tried LeetCode every day 121 Best Time to Buy and Sell Stock (Python, Go)
What to do if Python does not switch from the System version in pyenv
I tried the python version of "Consideration of Conner Davis's answer" Printing numbers from 1 to 100 without using loops, recursion, and goto "
I want to see the file name from DataLoader
[Python] How to remove duplicate values from the list
I tried to graph the packages installed in Python
The wall of changing the Django service from Python 2.7 to Python 3
What I got into Python for the first time
I tried Python on Mac for the first time.
I tried to detect the iris from the camera image
I want to scroll the Django shift table, but ...
Machine learning python code summary (updated from time to time)
I tried to implement Minesweeper on terminal with python
I tried to touch the CSV file with Python
Output the time from the time the program was started in python
I tried to solve the soma cube with python
I tried python on heroku for the first time
How to instantly launch Jupyter Notebook from the terminal
[Python3] I want to generate harassment names from Japanese!
The first step to getting Blender available from Python
[Python] I tried to graph the top 10 eyeshadow rankings
I want to write in Python! (3) Utilize the mock
I tried to solve the problem with Python Vol.1