In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how Centos6.5 installs python2.7.5+pip. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1. Download the package
$wget https://python.org/ftp/python/2.7.5/Python-2.7.5.tar.bz2-- no-check-certificate
two。 Go to the download directory and unzip it
$tar-xvf Python-2.7.5.tar.bz2
3. Create a new folder as the installation path
$mkdir / usr/local/python27
4. Under the decompressed path, compile and install
$cd Python-2.7.5.tar.xz
$. / configure-prefix=/usr/local/python27
$make
$make install
5. Change the old version to an alias at this time
$mv / usr/bin/python / usr/bin/python2.6.6
6. And then establish a link to the new version of python.
$ln-s / usr/local/python27/bin/python2.7 / usr/bin/python
7. At this point, type python and the latest version information will be displayed
Python 2.7.5 (default, Jan 15 2017, 13:56:08)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
> > >
8. If you use pip at this time, you will prompt command not found
Pip's official website suggests that if it is already 2.7.9 or later, it will come with pip. At that time, without paying attention to whether there is pip in the bin directory, we rashly downloaded a new copy of get_pip.py, such as
If you enter the directory and see pip (the full directory is / usr/local/python27/bin), you can skip steps 9 and 10
9. Download get_pip.py
$wget https://bootstrap.pypa.io/get-pip.py-- no-check-certificate
Do not add-- no-check-certificate will prompt for certificate error
10. Execute pip, and pip,setuptools,wheel will be installed.
$python get_pip.py
Just wait for it to be finished. It can't be used at this time.
11. And then make a link.
$ln-s / usr/local/python27/bin/pip2.7 / usr/bin/pip
I have pip,pip2,pip2.7 displayed locally, and I will create the latest link
twelve。 Type pip, display Uage, and it's done.
$pip
Add:
Vim / usr/bin/yum
#! / usr/bin/python2.6.6
Vim / etc/profile
Export PYTHON_HOME=/usr/bin/python2.6.6
ExportPATH=$PYTHON_HOME/bin:$PATH
Thank you for reading! This is the end of this article on "how to install python2.7.5+pip in Centos6.5". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.