Conflicting versions of python in ubuntu
Question: So i had python 2.7.2 on my server and i needed to update it to python 2.7.3.
So i've tried to remove the 2.7.2 version and then install the new one using
the sources. I wasn't able to remove the 2.7.2 version cause the system uses
it to run crucial services on server, so i installed the 2.7.3 version in hope
that after that i would be able to remove the old version. Still i cant remove
the old version, although i'm able to execute the python 2.7.3 when i install
any module i cant import it. I added the path to sys.path and i started
finding the module but importing it causes another errors.

My python executes the /usr/local/bin/python which is the 2.7.3 version where
the problems are. If i try to execute python like this /usr/bin/python it
executes the old version and everything works fine there, i can import the new
installed modules.

So what can i do to make python 2.7.3 work?

I've searched a lot of tutorials and tried things like add the library in .pth
files on python and i started finding the modules but when importing it i get
errors like this:

    
    
    >>> import numpy
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/local/lib/python2.7/dist-packages/numpy/__init__.py", line 137, in <module>
        import add_newdocs
      File "/usr/local/lib/python2.7/dist-packages/numpy/add_newdocs.py", line 9, in <module>
        from numpy.lib import add_newdoc
      File "/usr/local/lib/python2.7/dist-packages/numpy/lib/__init__.py", line 4, in <module>
        from type_check import *
      File "/usr/local/lib/python2.7/dist-packages/numpy/lib/type_check.py", line 8, in <module>
        import numpy.core.numeric as _nx
      File "/usr/local/lib/python2.7/dist-packages/numpy/core/__init__.py", line 5, in <module>
        import multiarray
    ImportError: /usr/local/lib/python2.7/dist-packages/numpy/core/multiarray.so: undefined symbol: PyUnicodeUCS4_AsUnicodeEscapeString
    

Thanks for the help

EDIT PROBLEM SOLvED

So to solve the missing import modules i created a .pth file under
/usr/local/lib/python2.7/site-packages/ with the directories where the python
modules are and the python starts to find them. To fix the comptability
problems you can install python from sources and specify the unicode doing
./configure --enable-unicode

more information
[here](http://bytes.com/topic/python/answers/163553-undefined-symbol-
pyunicodeucs4)


Answer: Do not EVER mess with system python, EVER.

What you should do is install python 2.7.3 with a --prefix into your home
directory, then use `virtualenv -p /home/myuser/path/to/python`.

In any case, using virtualenv to run your own application is almost always a
good idea, as it avoids polluting the system package directories with
libraries you use in your own applications.

