Can there be a conflict between two different version of python ?
I have a program that needs access to Python 2.6, I have a environment variable setup, so the program that needs access to a subfolder of the Python 2.6 installation is suppose to access via this environment variable; C:\Python26\modules\;
The program is not accessing the sub-folder of Python 2.6 ?
In environment variable ... ,you should add root folder and scripts folder of python26. ... This is what you add to ... ... Restart. Test it out in cmd(command line) type ... . Now running program ... will use python26 and install modules with setuptools,pip will find and install to python26. ... ...
Test it out in cmd(command line) type python. Now running program pythnon somecode.py will use python26 and install modules with setuptools,pip will find and install to python26. python setup.py install pip install somepackage
I added the semi-colen before the python path that I need the program to access, the program is not finding the path in the system variable ?
I think you are mixing the understanding of environment variable and PYTHONPATH. Environment variable you set so Windows find the Python version you use. PYTHONPATH is the path Python search for Python code/programs.
To se where Python search you can do this.
>>> import sys
>>> print sys.path
#Here you get a list of all folder python search for code(PYTHONPATH)
#If you have a .py in one of this folders Python will find it
I don't understand what I should test out in a python command
No you should test python command out in command line for OS called cmd Here how it look for me when i type in python in cmd.
Microsoft Windows [Versjon 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Med enerett.
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win
Type "help", "copyright", "credits" or "license" for more information.
If environment variable is set up correct you can type python anywhere in cmd(command line) and Python will start. So to sum it up Environment variable is so that windows can find Python. PYTHONPATH is where Python search for Python code(.py).
Yes Python only find code in PYTHONPATH. There are some solutions,you can move your "modules subfolder" to a folder in PYTHONPATH. Usually all Python modules/code get placed in C:\Python26\Lib\site-packages
You can append to PYTHONPATH.
The only bad ting with this solution is that is not permanent.
To permanently add to PYTHONPATH,you can do this. Search for sitecustomize.py,if you dont find it make it in C:\Python26\Lib\site-packages In this sitecustomize.py file add this.
I created the sitecustomize.py file and witin this file I entered the path to the modules, restarted the computer. Then I ran 'import sys' followed by 'print sys' and in the list I couldn't find my modules path ? I did find out I had (2) sitecustomize.py files, one that you told me to create, the other in my software, that I can't edit.
No one else has experienced a headache, it just works when they place the correct modules in the right sub-folder.
Doesn't a environment variable dig into sub-folders to find what it needs ? For example if I have C:\python\modules\; in my envorinment variable and there is a subfolder called 'acme' will it dig for the scripts within 'acme' or stop searching ?
If it's suppose to check only listed directories, does it search for sub-directories / folders. I could reinstall everything, I want to solve it without going that route, it sounds simple to solve, yet it's not solved.