adorepump / chocolatey-packages

a list of packages i've been making for site chocolatey.org
3 stars 17 forks source link

easyinstall sets PYTHONPATH #24

Open avdv opened 10 years ago

avdv commented 10 years ago

Code at https://github.com/adorepump/chocolatey-packages/blob/master/easy.install/tools/chocolateyInstall.ps1#L118 argues:

PYTHONHOME variable is not required to Python works, but it is a good practice to have it.

This is wrong. Actually it breaks running python2 if you have python3 installed or vice versa. Observe:

$ echo %PYTHONHOME%
C:\Python34
$ py -2
  File "C:\Python34\lib\site.py", line 176
    file=sys.stderr)
        ^
$ py -3
Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

When calling python 2.x the PYTHONHOME points to python3 code which the python2 interpreter chokes upon.

So, setting PYTHONHOME is not a good idea. It is a user setting that should not be messed with. Thanks!