1

I have create a local python installation in ~/localpython/python276 After create a virtualenv as py276, I linked the idle to ~/localpython/python276 /bin/idle. I also activated the py276.

$ which python
/home/xxx/virtualenvs/py276/bin/python

$ python
Python 2.7.6 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.


$ bin/idle
Python 2.7.6
[GCC 4.6.3] on linux2
Type "copyright", "credits" or "license()" for more information.

All things seems correct. However, if I just use idle as command, it will still use system one, which does not make any sense because which idle returns the correct result.

$ which idle
/home/xxx/virtualenvs/py276/bin/idle
$ idle
Python 2.7.3
[GCC 4.6.3] on linux2
Type "copyright", "credits" or "license()" for more information.

any idea why this is happening?

Wang
  • 7,250
  • 4
  • 35
  • 66

1 Answers1

0

This is probably because idle typed alone on the command line is actually a symbolic link to the 2.7.3 installed version. You must either change the symbolic link or be more explicit with your command.

Symbolic Link(symlink) Definition.

How to symlink a file.

Community
  • 1
  • 1
jbertino
  • 11
  • 4
  • sorry I cannot accept the answer. As I mentioned in original post, the /home/xxx/virtualenvs/py276/bin/idle will call the correct python version. – Wang Jun 01 '14 at 19:41
  • Exactly, when you are more explicit and you type the literal path to the idle inside py276 it works, but `idle` alone on the command line is taken to mean the symbolic link for idle in the path section of your .bashrc which is pointing to an installation of Python2.7.3. – jbertino Jun 02 '14 at 00:20
  • I cannot understand you. In your post, you said I may link the bin/idle to a wrong version of python. But it is not true, as I said before. Now you said the idle command are still associate with system idle. But as I mentioned in the original post: `$ which idle` gives `/home/xxx/virtualenvs/py276/bin/idle`, which is not pointing to py273. – Wang Jun 02 '14 at 01:23