Centos7安装python3注意事项

make install必备的包:yum install libffi-devel -y 如没有安装会报:

ModuleNotFoundError: No module named ‘_ctypes’

安装完之后执行python依旧是2.x的版本,需要使用python3的格式来运行。可以建立一个软连接把python3映射到python命令来

mv /usr/bin/python /usr/bin/python.bak  #把之前的备份

ln -s /usr/python/bin/python3 /usr/bin/python

由于yum默认是2.x的python,所以我们要把python头换成python2

vim  /usr/bin/yum

把 #! /usr/bin/python修改为  #! /usr/bin/python2

同理 vim  /usr/libexec/urlgrabber-ext-down

Tip:pip官方源通常会出现无法下载的问题。通过修改国内源可以解决这个问题:

pip install xlrd -i http://pypi.douban.com/simple –trusted-host pypi.douban.com

下面是常用的国内源地址:

1)http://mirrors.aliyun.com/pypi/simple/ 阿里云

2)https://pypi.mirrors.ustc.edu.cn/simple/  中国科技大学

3) http://pypi.douban.com/simple/  豆瓣

4) https://pypi.tuna.tsinghua.edu.cn/simple/ 清华大学

5)  http://pypi.mirrors.ustc.edu.cn/simple/ 中国科学技术大学

enjoy it

分享到:

160 条评论

昵称
  1. Thank you for all of the labor on this web page. My niece enjoys managing investigation and it’s simple to grasp why. My partner and i learn all regarding the compelling ways you present functional steps through your website and welcome response from some other people on the area of interest while our own princess is in fact understanding a whole lot. Enjoy the rest of the year. You have been performing a tremendous job.

  2. http://www.vapormaxs.us

    I would like to show my passion for your kindness supporting those individuals that require assistance with this study. Your special dedication to getting the message across was amazingly beneficial and has continually empowered associates like me to reach their desired goals. The interesting hints and tips means a whole lot a person like me and a whole lot more to my peers. Thanks a ton; from all of us.

  3. here

    I do agree with all the ideas you have offered in your post. They are very convincing and will definitely work. Still, the posts are very brief for beginners. May you please prolong them a little from subsequent time? Thank you for the post.

  4. Les ptits tutos

    Hello, i think that i saw you visited my site so i came to “return the favor”.I am attempting to find things to enhance my website!I suppose its ok to use some of your ideas!!

  5. I would like to express thanks to you just for bailing me out of this type of dilemma. Just after browsing throughout the world-wide-web and obtaining ways which are not beneficial, I believed my entire life was gone. Existing minus the answers to the issues you’ve sorted out by means of your entire review is a crucial case, as well as the ones that would have in a wrong way damaged my entire career if I had not come across your website. Your main talents and kindness in maneuvering all things was very helpful. I am not sure what I would have done if I had not encountered such a step like this. I can at this time look forward to my future. Thanks a lot so much for your professional and result oriented help. I won’t be reluctant to propose the website to any person who desires care about this matter.

  6. I must show my respect for your kindness giving support to people who actually need guidance on that subject matter. Your real commitment to passing the solution across had become extraordinarily invaluable and have regularly enabled employees much like me to achieve their targets. Your own warm and friendly tips and hints denotes a lot a person like me and far more to my office workers. Many thanks; from each one of us.

  7. I want to convey my respect for your generosity giving support to people who have the need for help on in this issue. Your very own dedication to getting the message all through appeared to be certainly informative and have in most cases permitted somebody much like me to achieve their pursuits. Your important guideline means a whole lot a person like me and far more to my office workers. Regards; from everyone of us.

  8. I and my buddies came going through the best helpful tips located on your website and then all of the sudden got an awful suspicion I never thanked the web blog owner for those techniques. All of the guys became totally glad to read all of them and now have without a doubt been tapping into them. Thank you for indeed being well considerate and then for pick out this form of incredible things most people are really wanting to learn about. My honest apologies for not saying thanks to earlier.

  9. additional resources

    Absolutely pent written content, thank you for selective information. “He who establishes his argument by noise and command shows that his reason is weak.” by Michel de Montaigne.

  10. http://www.jordans.net.co

    I intended to post you one little bit of remark to help say thanks yet again for all the nice tips you’ve discussed on this website. It was certainly extremely generous with you to provide unhampered precisely what a few individuals could possibly have sold for an ebook in making some cash on their own, even more so seeing that you might well have tried it in the event you desired. Those things in addition worked to become a easy way to be aware that other people have similar fervor really like mine to figure out a great deal more in respect of this condition. Certainly there are thousands of more pleasant situations in the future for individuals that see your site.