14

I want to install Python 3.4.6 but it is only available in source code format.

The install options on the official Python website are Gzip'd source tarball and XZ compressed source tarball. I have never installed Python this way before so I don't know what to do. How do I install Python and what file do I download?

https://www.python.org/downloads/release/python-346/

jww
  • 97,681
  • 90
  • 411
  • 885
Markus
  • 331
  • 2
  • 4
  • 13
  • 1
    Python is available in binary formats as well. What operating system are you using? – Alden Apr 25 '17 at 22:45
  • @Alden I am using windows 10 and this specific version of Python is only available in source code. https://www.python.org/downloads/release/python-345/ – Markus Apr 25 '17 at 22:47
  • There are install packages for Python 3.4.4: https://www.python.org/ftp/python/3.4.4/. If the third version number means nothing to you... – Philip Tzou Apr 25 '17 at 22:51
  • @PhilipTzou I would rather use python 3.4.6 – Markus Apr 25 '17 at 22:54
  • Ok so there's no official windows install package for 3.4.6 and you had to either build it by yourself or find it from some third-party website. I don't recommend the second way since it could be dangerous for your computer. – Philip Tzou Apr 25 '17 at 22:58
  • Why exactly 3.4.6 and not 3.5.0 or 3.4.4 (as already mentioned) or any other version. It just sounds oddly specific, is there a specific reason? – vallentin Apr 25 '17 at 22:58
  • @Vallentin I need a pre 3.5 version for Kivy and 3.4.6 is the latest one. – Markus Apr 25 '17 at 23:01
  • @PhilipTzou How hard would it be to build the install package – Markus Apr 25 '17 at 23:01
  • @Markus: As the answer described. You have to install Visual Studio 2010 Express. – Philip Tzou Apr 25 '17 at 23:03
  • Is it worth it to build it or should I just install 3.4.4? – Markus Apr 25 '17 at 23:08
  • @Markus: Just install 3.4.4 and try if it works. It won't take you too much time (even less than asking question here.:P ) – Philip Tzou Apr 25 '17 at 23:09
  • Why do you say you need pre-3.5 for Kivy? – user2357112 Apr 25 '17 at 23:21
  • @user2357112 This is from the install page on the kivy website. Warning Support for Python 3.5 and higher isn’t available with the current stable version (1.9.1). Compile the master branch or use the nightly wheels. Kivy website here (https://kivy.org/docs/installation/installation-windows.html) – Markus Apr 25 '17 at 23:30
  • Possible duplicate of [How would I build python myself from source code on Ubuntu?](https://stackoverflow.com/q/8097161/608639) – jww Mar 25 '19 at 05:32

3 Answers3

7
  1. Download the source as a .tar.gz
  2. Extract the source using a program such as 7-Zip
  3. Follow the instructions in PCbuild\readme.txt

You will need Visual Studio 2010 Express, which is becoming increasingly hard to find. See the comments in this question for a link to download it. You can also try Visual Studio Community 2017, which will probably work as well. All that you really need to do is open a solution and click build.

Community
  • 1
  • 1
Alden
  • 2,229
  • 1
  • 15
  • 21
  • 1
    Is it worth it to build it or should I just install 3.4.4? – Markus Apr 25 '17 at 23:08
  • You are probably fine with 3.4.4, but if you need the extra bug fixes or features in the later release then I would build. – Alden Apr 25 '17 at 23:10
5

Use the latest version

Step 1 – Prerequsiteis Use the following command to install prerequisites for Python before installing it.

sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev \
    libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

Step 2 – Download Python 3.7 Download Python using following command from python official site. You can also download latest version in place of specified below.

cd /usr/src
wget wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz

Now extract the downloaded package.

sudo tar xzf Python-3.7.0.tgz

Step 3 – Compile Python Source Use below set of commands to compile python source code on your system using altinstall.

cd Python-3.7.0
sudo ./configure --enable-optimizations
sudo make altinstall
make altinstall is used to prevent replacing the default python binary file /usr/bin/python.

Step 4 – Check Python Version Check the latest version installed of python using below command

python3.7 -V

Python-3.7.0
Sonia Rani
  • 608
  • 9
  • 4
1

The Python 3.4 branch is in security fixes only mode. This means that only security fixes will be accepted on this branch, no more non-critical bug fixes. New releases on this branch are source-only, no binaries will be provided. See the official announcement.

If you really need a python 3.4.6 binary for windows, you will have to compile it yourself. But if you're new to python and just want to try or learn python, there's no reason why you couldn't use version 3.4.4, or 3.6.x.

jlh
  • 4,349
  • 40
  • 45