I have used set PYTHONPATH=%PYTHONPATH%;dictionary_containing_modules
to make some modules globaly visiable.
I have a script importing the modules with import my_module
.
When i run the script from the iPython shell (run my_script.py
), i get no errors and the script runs as int开发者_开发技巧ended, but when I run the script from the command promt (windows) with python my_script.py
I get the error:
ImportError: No module named my_module
I checked with pwd
that they use the same working directory.
Remember that you can dynamically change your system path from within your script, using sys.path
or the site
module. So maybe you want to add them to your script...
Or maybe you want to write a BAT or Python launcher script that sets the PYTHONPATH...
Or you want to edit the Windows environment variables (somewhere inside System properties Win+Break).
精彩评论