Ubuntu – Problem in installing Python 3.3 in Ubuntu 12.04

installationpython

Initially I installed Python 3.3 from source, but then I removed and deleted the directory /usr/lib/python3.3.

When I am installing it using aptitude, I am getting this error.

Unpacking python3.3 (from .../python3.3_3.3.1-1ubuntu5_i386.deb) ...
Processing triggers for man-db ...
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for desktop-file-utils ...
Setting up python3.3 (3.3.1-1ubuntu5) ...
python3.3: can't open file '/usr/lib/python3.3/py_compile.py': [Errno 2] No such file or directory
dpkg: error processing python3.3 (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 python3.3
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up python3.3 (3.3.1-1ubuntu5) ...
python3.3: can't open file '/usr/lib/python3.3/py_compile.py': [Errno 2] No such file or directory
dpkg: error processing python3.3 (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:

Any idea how to rectify the error?

Best Answer

You've destroyed the libpython3.3-minimal package in that removal. Reinstall it, than try installing python3.3 again. If you have other packages installed that depend on libpython3.3-minimal, they may need to be reinstalled too.

Note: For next time, manually installed software should go in /usr/local or /opt, never to /usr directly. That avoids conflict between manually installed files and packages, because all packages are installed to /usr.

Related Question