Python replacement memo in Centos7
# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
# yum install -y https://centos7.iuscommunity.org/ius-release.rpm
# yum search python36
# yum install -y python36u python36u-libs python36u-devel python36u-pip
Symbolic link replacement
# ls -l /bin/py*
# ln -s /bin/python3.6 /bin/python3
# unlink /bin/python
# ln -s /bin/python3.6 /bin/python
# vim $(which pip)
The first line#!/usr/bin/python2 → #!/usr/bin/python
# pip --version
pip 9.0.1 from /usr/lib/python3.6/site-packages (python 3.6)
If you are using awscli
# vim $(which aws)
The first line#!/usr/bin/python2 → #!/usr/bin/python
If you get the following error
# aws s3 ls
Traceback (most recent call last):
File "/bin/aws", line 19, in <module>
import awscli.clidriver
ModuleNotFoundError: No module named 'awscli'
install
# sudo pip install awscli
yum also stops working.
# yum
File "/bin/yum", line 30
except KeyboardInterrupt, e:
^
SyntaxError: invalid syntax
When it comes to python3, the print statement has changed to print (), The exception catch syntax has changed from (comma) to as. If you re-paste the link, you can use it normally. .. Hmm? What should I do
Recommended Posts