今天买了阿里云服务器的云翼计划的学生服务器,配置听说是入门级的,对于我这种新手来讲都是差很少的了,遇到一些问题:python
IUS软件源中包含了Python3.6,能够使用IUS软件源安装Python3.6shell
1)安装IUS软件源centos
1 #安装EPEL依赖 2 sudo yum install epel-release 3 4 #安装IUS软件源 5 sudo yum install https://centos7.iuscommunity.org/ius-release.rpm
2)安装Python3.6服务器
1 sudo yum install python36u
安装Python3完成后的shell命令为python3.6,为了使用方便,建立一个到python3的符号连接scrapy
1 sudo ln -s /bin/python3.6 /bin/python3
3)安装pip3阿里云
安装完成python36u并无安装pip,安装pipcentos7
1 sudo yum install python36u-pip
安装pip完成后的shell命令为pip3.6,为了使用方便,建立一个到pip3的符号连接spa
sudo ln -s /bin/pip3.6 /bin/pip3
1 #include "Python.h" 2 ^ 3 compilation terminated. 4 error: command 'gcc' failed with exit status 1 5 6 ---------------------------------------- 7 Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-9igalvkz/Twisted/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-tesv2pzh/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-9igalvkz/Twisted/
解决方案:code
1 yum search python3 | grep devel
1 [root@iZ2zebg8yn9qw8bqhc9isxZ ~]# yum search python3 | grep devel 2 python34-cairo-devel.x86_64 : Libraries and headers for python34-cairo 3 python34-greenlet-devel.x86_64 : C development headers for python34-greenlet 4 python34-devel.x86_64 : Libraries and header files needed for Python 3 5 : development 6 python34-gobject-devel.x86_64 : Development files for embedding Python 3.4 7 python34u-devel.x86_64 : Libraries and header files needed for Python 3 8 : development 9 python35u-devel.x86_64 : Libraries and header files needed for Python 3 10 : development 11 python36-devel.x86_64 : Libraries and header files needed for Python development 12 python36-idle.x86_64 : A basic graphical development environment for Python 13 python36u-devel.x86_64 : Libraries and header files needed for Python 14 : development 15 shiboken-python34-devel.x86_64 : Development files for shiboken
找到 python36u-devel 执行:blog
1 sudo yum install python36u-devel
执行完毕以后,再次执行安装指令:
1 pip3 install scrapy
执行成功,安装完毕。