I
I
Igor2013-03-12 17:24:56
linux
Igor, 2013-03-12 17:24:56

How to install Python3.3 on Debian x64?

Situation: on a remote Debian 6 x64 server. We are trying to start a Python script there.
For the script to work, you need Python 3.3 (this is the version, others do not roll) with the sqlite3 module (because the script writes to the database in this format)

By default, python 2.7 is installed on the server.

Managed to build python3.3 from source.
Somewhere in the net I took a manual, the link was not saved:

wget http://python.org/ftp/python/3.3.0/Python-3.3.0.tar.bz2
tar jxf ./Python-3.3.0.tar.bz2
cd ./Python-3.3.0
./configure --prefix=/opt/python3.3
make && sudo make install
mkdir ~/bin
ln -s /opt/python3.3/bin/python ~/bin/py



But it is not clear how he can build sqlite3. Trying to install sqlite3:
apt-get install sqlite3

causes it to install for Python 2.7. Which, in general, is expected.

An attempt to get away from a bunch of different pythons to a single version without building python 3.3 from source was unsuccessful. I read this article . I found the python of the required version and for the required architecture

I registered the python3.3 repository in /etc/apt/sources.list like this:
deb ftp.de.debian.org/debian experimental main

updated info on packages:
apt-get update && apt-get upgrade

and when we try to install version 3.3:
apt-get install python3.3 
a bunch of unmet dependencies in other packages fall out:
apt-get install python3.3

Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
python3.3: Depends: python3.3-minimal (= 3.3.0-12) but it is not going to be installed
Depends: libpython3.3-stdlib (= 3.3.0-12) but it is not going to be installed
E: Broken packages


пытаемся установить python3.3-minimal:

apt-get install python3.3-minimal

Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
python3.3-minimal: Depends: libexpat1 (>= 2.1~beta3) but 2.0.1-7+squeeze1 is to be installed
Recommends: python3.3 but it is not going to be installed
E: Broken packages



How to solve the issue in the end?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
I
Igor, 2013-03-14
@shanker

Problem solved. According to the error given when executing the script, I googled this page .
Then I rebuilt python 3.3 (I wrote in the subject how I did it) and it all worked

Z
z0rc, 2013-03-12
@z0rc

Something doesn't add up. Let's go in order.

By default, python 2.7 is installed on the server.
How? The default is 2.6 . It's not in the backports.
But it is not clear how he can build sqlite3. Trying to install sqlite3 results in it being installed for Python 2.7. Which, in general, is expected.
sqlite3 does not depend on python and does not contain its modules in its distribution. I checked in the minimum root, the python is not installed when installing sqlite3.
I found a python of the required version and for the required architecture
You can't satisfy all dependencies, they've come a long way. Most likely everything will rest against libc6, which will require updating the entire system.
In general, there is a way out of this situation. You need to backport python3.3 from experimental. More or less like this:
apt-get -t experimental source python3.3
cd python3.3/debian
dch --bpo
cd..
dpkg-buildpackage -us -uc
and satisfy the dependencies until it builds. Most likely you will have to carry something from squeeze-backports. You may need to slightly tweak the assembly rules. And you need to consider, you will still have two pythons on the server. Since 2.x comes by default, all packages from the standard repository will envy it.

S
smartlight, 2013-03-12
@smartlight

Install the necessary packages (libpython3.3-stdlib, libexpat1).
Probably from the same repository as python3.
And keep your fists so that nothing breaks. For the test, I would first do this on a virtual machine.

M
MechanisM, 2013-03-14
@MechanisM

try pythonbrew or pythonz via the latter and pypy can be installed. Well, choose which one you need by default.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question