在准备安装python3和pip3时,请先安装依赖环境:yum install -y libffi-devel,和 yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel一定要先装!不然会出现如下例一连串连锁反应的bug
在安装linux的centos里安装python3报错:
File "/usr/local/src/Python-3.7.0/Lib/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named ‘_ctypes‘
make: *** [install] Error 1
踩坑踩得我不要不要的,此处报错,是没有安装依赖环境yum install -y libffi-devel导致,若此处报错,你的stuptools,pip 都安装不上,正确姿势应该是这样
Looking in links: /tmp/tmplw5bl0fh
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-19.0.3 setuptools-40.8.0
pip需要用的环境:yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel,不安装软连接无法添加,即便添加了也是2.7的版本
另外当你在安装python3时报上面的错,你再去安装yum install -y libffi-devel,会报找不到python这个文件夹,因为你用mv python python.bak 命令备份并且将其删除了,所以,你需要先将python恢复。
这里附上恢复python作者文章地址 https://www.cnblogs.com/sueyyyy/p/10410832.html
安装python3和pip3的作者地址:https://www.cnblogs.com/yoyoketang/p/10195102.html
继续踩坑去,感觉后面无数的坑等着我。。。。在心里为自己点无数根蜡,wish yourself luck