How to deal with old Python versions in Cloud9 made by others

--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.

Event: Python version was old

#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

Cause: .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

Action: Change the Python version specified in .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

How to deal with old Python versions in Cloud9 made by others
How to switch python versions in cloud9
[Python] How to deal with module errors
How to deal with python installation error in pyenv (BUILD FAILED)
How to deal with memory leaks in matplotlib.pyplot
[REAPER] How to play with Reascript in Python
How to use tkinter with python in pyenv
How to convert / restore a string with [] in python
How to do hash calculation with salt in Python
Explain in detail how to make sounds with python
How to deal with pyenv initialization failure in fish 3.1.0
[Python] How to deal with pandas read_html read error
How to deal with Executing transaction: failed in Anaconda
How to develop in Python
How to publish GitHub Pages with Pelican, a static HTML generator made by Python
How to extract any appointment in Google Calendar with Python
How to upload files to Cloud Storage with Firebase's python SDK
[AWS] How to deal with "Invalid codepoint" error in CloudSearch
For beginners, how to deal with common errors in keras
[Python] How to do PCA in Python
Python: How to use async with
How to collect images in Python
How to deal with imbalanced data
Numer0n with items made in Python
How to deal with imbalanced data
How to get started with Python
How to use Mysql in python
How to wrap C in Python
How to use ChemSpider in Python
How to use FTP with Python
How to use PubChem in Python
How to handle Japanese in Python
How to install OpenCV on Cloud9 and run it in Python
[GCP] How to publish Cloud Storage signed URLs (temporary URLs) in Python
How to use functions in separate files Perl and Python versions
How to use python put in pyenv on macOS with PyCall
How to connect to Cloud Firestore from Google Cloud Functions with python code
How to deal with errors when installing Python and pip with choco
How to display legend marks in one with Python 2D plot
How to calculate "xx time" in one shot with Python timedelta
Python Django How to deal with cases where Japanese carrier emails are played by Email Validator
[Introduction to Python] How to use class in Python?
Try logging in to qiita with Python
How to access environment variables in Python
How to dynamically define variables in Python
How to do R chartr () in Python
[Itertools.permutations] How to put permutations in Python
How to get a stacktrace in python
How to deal with enum compatibility errors
How to display multiplication table in python
How to extract polygon area in Python
How to do portmanteau test with python
How to check opencv version in python
How to display python Japanese with lolipop
How to use __slots__ in Python class
How to dynamically zero pad in Python
How to enter Japanese with Python curses
To work with timestamp stations in Python
How to use regular expressions in Python
How to display Hello world in python
How to use is and == in Python