Install the libffi-devel dependency, then recompile and install python3.7.1.
yum -y install libffi-devel
Execute the command to install again.
2. After installing Python, execute the version commands separately
$python -V
$Python3 -V
To use the new version, you need to link to the new version of Python (see the Python path, under /usr/bin. You can see the Python link is Python 2.7.
$ls -al /usr/bin | grep python
Rename the original Python soft link:
$mv /usr/bin/python /usr/bin/python.bak
Link Python to Python 3:
$ln -s /usr/local/bin/python3 /usr/bin/python
3. YUM cannot be used after changing the version
The terminal input yum list and report an error
$yum list
File "/usr/bin/yum", line 30
except KeyboardInterrupt, e:
SyntaxError: invalid syntax
Modify /usr/bin/yum and /usr/libexec/urlgrabber-ext-down to #! The/usr/bin/python to #! /usr/bin/python2.7 = /usr/bin/python2.7 = /usr/bin/python2.7
$vi /usr/bin/yum
$vi /usr/libexec/urlgrabber-ext-down
4. If you do not have root access, you will need to update the PIP after you update Python. Installation steps are as follows:
Download address: https://pypi.org/project/pip/#files
Install command: pip3 install – install – option = “– prefix =/GPFS/home/chengqy/soft/path” PIP – 20.1.1 – py2. Py3 – none – any. WHL
Read More:
- Git solves the problem of failed: http request failed
- Raspberry pie upgrade to Python 3.7.3
- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full comm
- CentOS solves the problem of modulenotfounderror when salt calls python3 script remotely, and solves the problem that PIP3 module cannot be shared by different users
- Solve fatal error: ‘FFI. H’ file not found
- Solutions to the failure of importing Python 3.7 SSL module
- Cydia sub-process/USr/Libexec/Cydia/Cydo error 100
- When linux installs rpm, it prompts: can’t create transaction lock on /var/lib/rpm/.rpm.lock error
- Linux error deletion libc.so.6 how to recover
- VirtualBox installation enhancement error “modprobe vboxguest failed”
- Solution of modulenotfounderror in running pychar
- The app failed to start because there is no Qt platform to initialize
- configure: error: readline library not found solution
- Error: could not find a version that satisfies the requirement flake8 (from versions: none) (Fixed)
- Using pip to install tensorflow: tensorflow — is not a supported wheel on this platform
- On the problem of from PIL import image
- Configuration (9) to solve the problem of “setup tools PIP wheel failed with error code 1”, create virtual environments with Python of anaconda
- How to update Spyder under Anaconda?
- CentOS Basic XLib functionality test failed!
- Data analysis to obtain Yahoo stock data: some problems are encountered when using panda datareader (cannot import name ‘is_ list_ Like ‘problem)