0

Is there a special setup needed to run a gui application from the command line (i.e. python pyqtapp.py) ?

When I run it from the dos prompt it complains about the modules in my .py file.. like 'no module named winreg'. Yet it executes fine under Idle.

It seems like it's a path issue, but the Windows enviroment path is set correctly.. especially since I have no problem running the script from within the IDLE ide. I know I should probably be using a more professional IDE like pycharm, but IDLE seems to work well enough so I haven't changed.. Unless it's CAUSING an issue with the command line working?

What could cause this?

ben
  • 473
  • 2
  • 9
  • 21
  • try PYTHONPATH, http://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows-7 – Dyno Fu Apr 07 '15 at 00:04
  • Setting enviroment variables (PATH, PYTHONPATH and PYHOME) to 'C:\Python34;C:\Python34\Lib;C:\Python34\Lib\site-packages' didn't seem to do anything. – ben Apr 08 '15 at 16:10
  • https://docs.python.org/2/library/_winreg.html i think your python version in idle is python 3, and command line is python 2. – Dyno Fu Apr 08 '15 at 16:35
  • Please don't hide crucial information when asking a quesiton. What is 'xxx' really? Also, try `import sys; print(sys.path)` both in Idle and command line and see what is difference and if 'xxx' is related to difference. – Terry Jan Reedy Apr 08 '15 at 20:54
  • @Terry The reason I put xxx is because it changes depending on what package I import first, if I move import queue to the top it'll say no module named queue, etc, etc. It seems to be a general import module issue rather than a specific module problem. – ben Apr 09 '15 at 18:18
  • @Terry, Almost forgot printing sys.path does show a different output from Idle and the command line! The command line looks totally different (and maybe not even properly formed!). Where does it get it from, and/or how to I force it to use the same path that IDLE is using? – ben Apr 09 '15 at 18:22

0 Answers0