简体   繁体   中英

Python 2.6 and 2.7 colliding

The default python on my machine was 2.6, and I downloaded tarball for 2.7 and built it. If I run the python command, it boots up 2.7.5 shell, yet pip pulls modules from 2.6 directory, so I can't download any modules, since it's saying that it already exists.

Output from ls -l python* at usr/bin:

lrwxrwxrwx. 1 root root   18 Jul  7 01:20 python -> /usr/bin/python2.6
lrwxrwxrwx. 1 root root    6 Jul  2 00:29 python2 -> python
-rwxr-xr-x. 1 root root 4864 Jan 22  2014 python2.6
-rwxr-xr-x. 1 root root 1418 Jan 22  2014 python2.6-config
lrwxrwxrwx. 1 root root   16 Jul  2 00:29 python-config -> python2.6-config

Output from which python :

/usr/local/bin/python

I rm ed /usr/bin/python once after downloading the tar.

How do I set the directory correct, so pip and everything starts working again?

Use virtual environments. There's a lot of python-dependent things in Linux, and changing up the system python causes all kinds of chaos. If you need a version other than your distro's default, virtual environments are probably the easiest way to make every work smoothly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM