Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Hi I have recently upgraded from debian lenny to squezee and I noticed some problems during upgrade with some python files. Now I have same problem with them and I need to resolve it so that I can install printer drivers and sane:

dpkg --configure -a
Setting up python-imaging (1.1.7-2) ...
Traceback (most recent call last):
  File "/usr/local/lib/python2.5/runpy.py", line 95, in run_module
    filename, loader, alter_sys)
  File "/usr/local/lib/python2.5/runpy.py", line 52, in _run_module_code
    mod_name, mod_fname, mod_loader)
  File "/usr/local/lib/python2.5/runpy.py", line 32, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.5/py_compile.py", line 164, in <module>
    main()
  File "/usr/local/lib/python2.5/py_compile.py", line 159, in main
    compile(filename, doraise=True)
  File "/usr/local/lib/python2.5/py_compile.py", line 115, in compile
    f = open(file, 'U')
IOError: [Errno 2] No such file or directory: '-'
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 320, in <module>
    main()
  File "/usr/bin/pycompile", line 299, in main
    options.force, options.optimize, e_patterns)
  File "/usr/bin/pycompile", line 217, in compile
    pipe.send(fn)
  File "/usr/bin/pycompile", line 180, in py_compile
    stdin.write(filename + '\n')
IOError: [Errno 32] Broken pipe
dpkg: error processing python-imaging (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
python-imaging

Same error with:

aptitude -f install 

And same error:

# apt-get --reinstall install python-imaging
Reading package lists... Done
Building dependency tree 
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 11 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up python-imaging (1.1.7-2) ...
Traceback (most recent call last):
File "/usr/local/lib/python2.5/runpy.py", line 95, in run_module
filename, loader, alter_sys)
File "/usr/local/lib/python2.5/runpy.py", line 52, in _run_module_code
mod_name, mod_fname, mod_loader)
File "/usr/local/lib/python2.5/runpy.py", line 32, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.5/py_compile.py", line 164, in <module>
main()
File "/usr/local/lib/python2.5/py_compile.py", line 159, in main
compile(filename, doraise=True)
File "/usr/local/lib/python2.5/py_compile.py", line 115, in compile
f = open(file, 'U')
IOError: [Errno 2] No such file or directory: '-'
Traceback (most recent call last):
File "/usr/bin/pycompile", line 320, in <module>
main()
File "/usr/bin/pycompile", line 299, in main
options.force, options.optimize, e_patterns)
File "/usr/bin/pycompile", line 217, in compile
pipe.send(fn)
File "/usr/bin/pycompile", line 180, in py_compile
stdin.write(filename + '\n')
IOError: [Errno 32] Broken pipe
dpkg: error processing python-imaging (--configure):
subprocess installed post-installation script returned error exit status 1
configured to not write apport reports
Errors were encountered while processing:
python-imaging
share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

One of your problems is that you have one or more versions of python locally installed. I get

$ dlocate runpy.py
  python2.5-minimal: /usr/lib/python2.5/runpy.py
  python2.6-minimal: /usr/lib/python2.6/runpy.py

However, I see /usr/local/lib/python2.5/runpy.py in your script above. This means you have a local copy of python 2.5 installed, and your system is trying to use it. You probably installed it at some earlier time when 2.5 was not the default version, and possibly not available in Debian. However, there is no reason to have a local version of Python 2.5 installed any longer.

I suggest you remove your local python installation(s) and install the correct Debian packages. Also, you are incorrect to think that the package trying to use 2.5 is wrong. In squeeze all python packages are compiled with support for 2.5 and 2.6. HTH.

share|improve this answer
    
$ dlocate runpy.py python2.6-minimal: /usr/lib/python2.6/runpy.py Now I have this situation. Is this correct for squeeze or I could get some problems later. –  Matija Mar 12 '11 at 7:09
    
@Matija: That looks better. I suggest that you review your local installations, ie everything in /usr/local to make sure you don't have any other packages installed locally that should be part of the Debian installation. –  Faheem Mitha Mar 12 '11 at 7:58
    
@Matija: Just to be clear, you did remove the local installation of python 2.5, right? –  Faheem Mitha Mar 12 '11 at 8:00
add comment

There was some problems with python version because as you can see it tried to use python2.5.

My update-alternatives had only 2.4 and 2.5. Then I have removed python2.4 and python2.5 and finally changed symlink /usr/bin/python to point to python2.6 (altough I thought that it points to python2.6). And finally everything works perfectly.

share|improve this answer
    
I don't think you needed to manually put a symlink there. There's a package named *python-defaults in Squeeze, and it should that (and more) for you. –  Tshepang Feb 18 '11 at 11:41
    
How can I install it and use it ? My problems are now solved but if this is preferred way I would like to know. –  Matija Feb 18 '11 at 11:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.