Python 2.7 still accesses Python 3.4 directories

I installed Python 2.7 when I already installed Python 3.4 on my system.

Now when I try to run python27 it still tries to access the Python 3.4 folders and thus get errors.

C:\Users\user>python27
  File "E:\Python\Lib\site.py", line 176
    file=sys.stderr)
        ^
SyntaxError: invalid syntax

      

It should access E:\Python27

(which contains 2.7) instead of E:\Python

(which contains 3.4).

Version and commands work:

C:\Users\Lorenz>python --version
Python 3.4.3

C:\Users\Lorenz>python27 --version
Python 2.7.9

      

I have both Python versions in environment variables.

EDIT: I just removed all 3.4 environment variables associated with this, and oddly enough, both 2.7 and 3.4 work.

+3


source to share


1 answer


As long as you don't need environment variables (for example PYTHONPATH

) for both installations, it will work for you. However, I highly recommend using virtualenv , it helps to isolate problems related to libraries and installed interpreters.



Also a nice guide .

+3


source







All Articles