When i'm running the program in the IDLE for python 3.4, the program works fine and as intended. However, when using python Console (through python.exe) the Console returns "ImportError: No Module named tkinter". I am aware of the differences of tkinter (3.x) and Tkinter (2.x) and am sure it is not this. It might be related to the nonstandard Python build I am using, WorldViz's Vizard.
Asked
Active
Viewed 196 times
-1
-
You could use a `try` block to test your original theory. – Zizouz212 Jun 16 '15 at 00:03
-
1Are you sure the Python console you're getting is from the same version of Python that you're getting with IDLE? What version does it show when you first run `python.exe`? – Blckknght Jun 16 '15 at 00:06
-
I suppose you tried changing it to `Tkinter` and running the program through the console, and it said `ImportError: No module named 'Tkinter'`? – TigerhawkT3 Jun 16 '15 at 00:12
-
The computer Im using is running the Prgram from "C:\Program Files\WorldViz\Vizard5\bin\python.exe" (Vizard is python based Oculus Rift coding) - as stated by sys.executable. Now I know that this is the problem, how would I go about changing how it starts up? Ps. im running Windows. Thanks for uberfast reply! – Revexious Jun 16 '15 at 00:12
-
Does Vizard have an implementation of `tkinter`? – TigerhawkT3 Jun 16 '15 at 00:14
-
Not that I know of, how do I change the start up of the script over to Python34. Thanks – Revexious Jun 16 '15 at 00:14
-
Do you have a standard build of Python 3 installed? If so, specify it when you run your program (e.g. `C:\Python34\python.exe myprogram.py`). – TigerhawkT3 Jun 16 '15 at 00:18
-
He's not using those; he's using a 3rd party Python build. – TigerhawkT3 Jun 16 '15 at 00:21
-
Adding the specification has worked. Thanks a bunch!! – Revexious Jun 16 '15 at 00:24
1 Answers
1
If your environment variables are pointing to a nonstandard Python build that doesn't include your desired module, you can specify the correct Python build rather than relying on py
or python
at the command line:
C:\Users\You> C:\Python34\python.exe myprogram.py

TigerhawkT3
- 48,464
- 6
- 60
- 97