Python installing on Debian

Haim Ashkenazi haim at babysnakes.org
Mon Mar 29 03:43:25 CEST 2004


Guillaume Gervais wrote:

> Hello there,
> 
> I'm using Debian GNU/Linux testing/unstable (sarge) as an operating
> system. About a month ago, I installed python 2.3 on my machine, from the
> sources.
> 
> And it worked perfectly.  But about 3 weeks ago, I made a update of the
> packages list (apt-get update) followed by a apt-get dist-upgrade.  I
> short, I upgraded Debian.
> 
> But among the ugraded packages was python2.3.  And it doesn't seem to
> install properly.  Here is the error message (it is in french, since my
> mother tongue is french...) :
> 
> # apt-get install package
> [...]
> Paramétrage de python2.3 (2.3.3-6) ...
> Compiling python modules in /usr/lib/python2.3 ...
> 'import site' failed; use -v for traceback
> SyntaxError: ('future feature rested_snopes is not defined',)
> 
> SyntaxError: ('from __future__ imports must occur at the beginning of the
> file',)
> 
> SyntaxError: ('from __future__ imports must occur at the beginning of the
> file',)
> 
> SyntaxError: ('from __future__ imports must occur at the beginning of the
> file',)
> 
> SyntaxError: ('from __future__ imports must occur at the beginning of the
> file',)
> 
>   File "/usr/lib/python2.3/test/badsyntax_nocaret.py", line 2
>     [x for x in x] = x
> SyntaxError: can't assign to list comprehension
> 
> dpkg : erreur de traitement de python2.3 (--configure) :
> le sous-processus post-installation script a retourné une erreur de sortie
> d'état 1
> Des erreurs ont été rencontrées pendant l'exécution :
> python2.3
> E: Sub-process /usr/bin/dpkg returned an error code (1)
> 
> 
> 
> But there are some python programs I am using that works fine.  But this
> line :
> 
> 'import site' failed; use -v for traceback
> 
> appears very often when I run python programs (but the program itself
> works fine).
> 
> When using apt-get, the package I am installing installs fine, same thing
> when I am removing a program, but the error message always appears at the
> end, and it is very annoying.
> 
> Can someone help me out?
It's a very bad idea to install self-compiled applications to the same
prefix as the ones from original packages. this can breake many things on
your computer. what you have now is a semi-broke python installation, and a
package that tries to install itself every time you run apt-get but fails.

I think your best chance to "clean" things would be to uninstall every
python2.3 package on your system (see what happenes when you run 'apt-get
remove --purge python2.3'). but make sure you understand what you're doing
(e.g. do you really want to purge your zope installaion? do you have
important stuff there, do you know how to restore it?). then if there's
still stuff in /usr/lib/python2.3 and /usr/local/lib/python2.3 check that
they don't belong to any package (with dpkg -S filename) and remove them.
also check if you have a python binary in /usr/local/bin and delete it.
then re-install all the python2.3 packages. this of-course will make you
lose all your self-compiled modules, so you'll have to re-compile them.
this is a long and messy job, but you got yourself into this position. just
make sure you understand what you're doing before your doing it.

in the future I would recommend using the source from unstable to build a
package if you want a version newer then the one that exist in testing.
also use 'stow' when you're compiling sources. this will let you uninstall
self-compiled application easilly.


> 
> Thanks a lot,

good-luck (you'll need it) :(
--
Haim






More information about the Python-list mailing list