--Environment: Cloud9 ――My colleague was using Cloud9 using EC2, so I wanted to use it too, so I asked Cloud9 to create an account and started using it immediately.
#Python is not 3!
$ python --version
Python 2.7.18
#pip is ... for some reason Python3.6 things?
$ pip --version
pip 20.2.4 from /home/ec2-user/.local/lib/python3.6/site-packages/pip (python 3.6)
#There seems to be Python3 ...
$ python3 --version
Python 3.6.12
Should I change Python in Cloud9 to 3? I thought it was already ...
--Reference: Change the Python version of Cloud9 to Python3 [amazon AWS] | dot blog
# 「+Is attached to Python3 ... but I'll select it for the time being
$ sudo update-alternatives --config python
There are 3 programs which provide 'python'.
Selection Command
-----------------------------------------------
* 1 /usr/bin/python2.7
+ 2 /usr/bin/python3.6
3 /usr/bin/python2.6
Enter to keep the current selection[+], or type selection number: 2
#It doesn't become Python3 ...
$ python -V
Python 2.7.18
.bashrc
specifies an older version#Python in my account is 2 ...
$ alias | grep python
alias python='python27'
#Python2 with alias.7 is set ...
$ cat ~/.bashrc | grep python
alias python=python27
.bashrc
# .Even if it is not bashrc, it is OK if the file is read in a later order
$ ls -la
# ...abridgement...
-rw-r--r-- 1 ec2-user ec2-user 336 Jul 24 2019 .bash_profile
-rw-r--r-- 1 ec2-user ec2-user 1401 Nov 20 06:48 .bashrc
-rw-rw-r-- 1 ec2-user ec2-user 118 Jul 24 2019 .zshrc
#Open with vi and with alias Python3.Specify 6
$ vi ~/.bashrc
$ cat ~/.bashrc | grep python
alias python=python36
#When reflected
$ source ~/.bashrc
function
# Python3.It became 6 ...
$ python --version
Python 3.6.12
Recommended Posts