Two Python Version conflict in Ubuntu Oneiric 11.10 issue: ImportError: No module -
i installed python 2.7.5 using make install not altinstall
previously 2.7.2+
now when run python gives
importerror: cannot import name maxrepeat
i know there entries related here. dont have virtualenv installed neither did have before.
if run python2.7
runs perfectly. when trying import library mysqldb says module doesnt exist. installed before installing python2.7.
what solution? should uninstall whole python or rather how should uninstall python2.7.5 or should keep that? if keep how can import modules?
** latest update**
me@me:/usr/local/bin$ dir python2* python2 python2-config python2.7 python2.7-config
and:
/usr/local/bin$ ls -l total 1776 -rwxrwxr-x 1 root root 101 jul 17 20:17 2to3 -r-xr-xr-x 1 root root 7223 mar 31 20:47 config_data -rwxr-xr-x 1 root root 299 jul 18 20:53 easy_install -rwxr-xr-x 1 root root 307 jul 18 20:53 easy_install-2.7 -rwxrwxr-x 1 root root 99 jul 17 20:17 idle -r-xr-xr-x 1 root root 3910 mar 31 20:47 json_pp -r-xr-xr-x 1 root root 487 mar 31 20:47 package-stash-conflicts -rwxr-xr-x 1 root root 281 jul 17 19:51 pip -rwxr-xr-x 1 root root 289 jul 17 19:51 pip-2.7 -rwxrwxr-x 1 root root 84 jul 17 20:17 pydoc lrwxrwxrwx 1 root root 7 jul 18 23:04 python -> python2 lrwxrwxrwx 1 root root 14 jul 18 23:04 python-config -> python2-config lrwxrwxrwx 1 root root 9 jul 18 23:04 python2 -> python2.7 lrwxrwxrwx 1 root root 16 jul 18 23:04 python2-config -> python2.7-config -rwxr-xr-x 1 root root 1737376 jul 18 23:03 python2.7 -rwxr-xr-x 1 root root 1674 jul 18 23:04 python2.7-config -rwxrwxr-x 1 root root 18547 jul 17 20:17 smtpd.py -rwxr-xr-x 1 root root 316 jul 18 21:10 virtualenv -rwxr-xr-x 1 root root 324 jul 18 21:10 virtualenv-2.7
would reinstalling solve problem of getting , running default 2.7.2+ in ubuntu back?: https://launchpad.net/ubuntu/oneiric/+source/python-defaults/2.7.2-7ubuntu2
* prior update*
now can run python bash
here new problem. , every module install using pip.
existing modules lib can imported newly installed ones cant be:
me:~$ sudo pip install requests downloading/unpacking requests downloading requests-1.2.3.tar.gz (348kb): 348kb downloaded running setup.py egg_info package requests installing collected packages: requests running setup.py install requests installed requests cleaning up... me:~$ python -i python 2.7.5 (default, jul 17 2013, 20:16:12) [gcc 4.6.1] on linux2 type "help", "copyright", "credits" or "license" more information. >>> import requests traceback (most recent call last): file "<stdin>", line 1, in <module> importerror: no module named requests >>>
after checking version of python running locally, conflict issues:
me:~$ python python 2.7.5 (default, jul 17 2013, 20:16:12) [gcc 4.6.1] on linux2 type "help", "copyright", "credits" or "license" more information. >>> exit() me:~$ sudo python [sudo] password me: python 2.7.5 (default, jul 17 2013, 20:16:12) [gcc 4.6.1] on linux2 type "help", "copyright", "credits" or "license" more information. >>> exit() me:~$ python /usr/local/bin/python me:~$ sudo python /usr/local/bin/python me:~$ sudo python2.7 /usr/local/bin/python2.7 me:~$ python2.7 /usr/local/bin/python2.7
i think running same. , then..
me:/usr/local/bin$ dir python2.7 python2.7 me:/usr/local/bin$ cd /usr/bin me:/usr/bin$ dir python2.7 python2.7 me:/bin$ cd /usr/bin me:/usr/bin$ dir python python me:/usr/local/bin$ dir python python me:/usr/local/bin$ dir python2.7 python2.7
also check following:
~$ pip /usr/local/bin/pip
ok installed virtualenv , did
(foldername)me@me:~/caller$ sudo pip install requests requirement satisfied (use --upgrade upgrade): requests in /usr/local/lib/python2.7/dist-packages cleaning up... (foldername)me@me:~/caller$ python -i python 2.7.2+ (default, jul 20 2012, 22:15:08) [gcc 4.6.1] on linux2 type "help", "copyright", "credits" or "license" more information. >>>
and can see 2.7.2+ again! happening now?? wrong?
uninstalling older python linux not recommended. how can run virtualenv 2.7.5 on , not 2.7.2+ ?!
when installing python use following steps
using prefix specify installation directory
./configure --prefix=/scratch/bin/ make sudo make install
then everytime u run new terminal u have specify
export path="$path:/scratch/bin/"
to tell installation directory of python
this way u can use number of pythons
Comments
Post a Comment