Linux python installed into the specified directory

Source: Internet
Author: User

Because there is no root permission to use the company server, only Python can be installed in the personal folder, using the source package method of installation, here to record.

1.python Downloads

CD to directory/users/w, install Python in this directory. Download the Python source package via the wget command:

wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz

2. Unzip python to the current directory

tar zxvf python-2.7. 9. tar. XZ
3. Compiling and installing
a)./configure--prefix=/users/w/python
By executing the script./configure starts compiling, which can determine the configuration of the system and create the corresponding makefile file. This makefile is primarily used by the next make command, which establishes the order in which Linux needs to build the program components in the order specified by makefile. --prefix=/users/w/python specifies that the installation directory is/users/w/python.
b) make

Make actually compiles the source code and generates the execution file.

c) Makeinstall

Make install actually copies the generated execution files to the necessary directories in the Linux system, such as copying to the/users/w/python/bin directory.

At this point, Python is installed in the/users/w/python directory.

4.setuptools Tool Installation

First download via the wget command:

wget https://pypi.python.org/packages/0a/40/ a740a4890d9cc8f725f67da158ab250d3926b874e0f7cb85bdc836e3d069/setuptools-24.0.0.tar.gz#md5= 75e7269ab0425efe590acbc834575f13
Extract
$tar zxvf setuptools-24.0. 0. tar. gz

Compile. First CD to Setuptools directory, because no link created, directly with the users/W/python/bin/pthon interpreter to execute

$/users/w/python/bin/pthon setup.py Build

Installation

$/users/winstall

After the installation is complete, you can use the Easy_install command.

Linux python installed into the specified directory

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.