Install Python 3.5.2 from source

Here are the procedures we are to follow,

  1. Download the source code of an official Python release.

  2. Configure the build appropriately for our machine.

  3. Compile the software.

  4. Test the software to make sure it works properly.

  5. Install the software.

  6. Configure our system to make sure we can use the software easily.

Getting a Python release

Go to the Python source downloads and choose a version to download (I’ll use 3.5.2 throughout this document but the process should be similar for any other version).

You can extract a tar archive file using the following command:

tar xf Python-3.5.1.tgz

tar’s argument handling is ancient and unlike almost all other UNIX programs so you probably needn’t bother learning how the work; just remember tar xf means “extract from a file”. Like most UNIX programs, tar will not produce any output unless it encounters an error or you specifically ask it to. If you’d like it to give you some feedback as it works use tar xvf instead (“extract verbosely from a file”).

You should now have a directory called Python-3.5.1/ which contains the release files. From now on I’ll assume we’re working inside this new directory:

cd Python-3.5.1/

Building Python

Most UNIX software uses a very similar build process:

  • first you configure the build with the install location, where to find any libraries it needs, etc.

  • then you compile the software

  • then you test the software

  • then you install the software

Each step is usually a single command and the whole process usually looks a little like this:

./configure
make
make test
sudo make install
Reference: https://passingcuriosity.com/2015/installing-python-from-source/

转载于:https://www.cnblogs.com/casperwin/p/6175779.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值