Ok, this is totally my fault. I should not have tried to install and compile Python 2.75. After everything went haywire, I saw someone on this site caution against doing this very thing.
I am running Django and it was working fine until the upgrade attempt. I then managed to switch the default version from 2.73 to 2.75 and by doing a
make install within the python dir. When I checked the version running the OS said 2.75, so I figured great it worked. NOT SO. Django then stopped working.
I attempted to switch back to 2.73 and that seemed to have worked. However, now I get python errors showing that Django, PIL etc are not installed. So, I thought to try and re-install them and I get these messages "Requirement already satisfied" and that the packages are in the dist-packages dir in the python 2. 7 directory. What happened? How do I fix this?
I have tried creating a running a simple test script containing this code:
from distutils.sysconfig import get_python_lib print(get_python_lib())
and it worked. So, I know python 2.73 is functional, but my libraries including Django do not work still. I tried adding
import site; site.getsitepackages() to one of my python scripts that uses PIL and i still get this error:
File "display.py", line 6, in <module> from imgProcess import imgProcess File "/var/www/opengov/imageXMLtoCVSTestPY/imgProcess.py", line 3, in <module> from PIL import Image ImportError: No module named PIL
I have tried running
sudo pip uninstall PIL to see if maybe re-installing it might clear the error. It asks if i want to proceed, naturally i say yes and it says it was removed. Now when i
ls /usr/lib/python2.7/dist-packages/PIL I see that it is still there and when i try to sudo pip install PIL, it of course says it is already there. What????