1

I have successfully installed Python3 and Pygame using the homebrew methods found here: Installing Pygame on Mac OS X with Python 3

After it was all done, I ran IDLE3, and the Import Pygame command ran successfully.

However now my goal is to get Wing IDE (specifically wing 101 for now) running and have it import pygame as well, but it does not seem to recognize pygame.

2.7.10 (default, Jul 13 2015, 12:05:58) 
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)]
Python Type "help", "copyright", "credits" or "license" for more information.
[evaluate untitled-2.py]
Traceback (most recent call last):
  Python Shell, prompt 2, line 1
ImportError: No module named pygame

Then when i try to do the Edit < Configure Python < (change the path) method, all I get is this error Some values are invalid:

Python executable '/usr/local/Cellar/python3/3.4.3_2/IDLE 3.app' is not a file. It should be the name of a Python interpreter that is on your PATH (such as python, python3.4, python.exe) or the full path to the Python interpreter you wish to use.

Please correct the values and try again.

I've tried looking everywhere for a solution, I'm pretty new at all of this as the only language i currently know is VB6 (basically caveman talk), but i really just want to get everything running smoothly so I can really get started learning.

Thanks :)

GuilhE
  • 11,591
  • 16
  • 75
  • 116
  • Make sure that Wing IDE is looking for python modules in the correct location. You don't want to change the path of your python _executable_, but you want to add paths to `sys.path` to include where your modules are actually installed. https://wingware.com/doc/intro/tutorial-python-path – Håken Lid Aug 08 '15 at 15:56
  • Also, it looks like WingIDE wants to use python2.7 instead of python3.4 - that might cause your problem. In which case you have to find the python3.4 executable and use that with WingIDE. From the command line you can try `which python3.4` to locate the correct executable file. – Håken Lid Aug 08 '15 at 16:00
  • It simply won't let me change the executable file, it's saying that IDLE.app is not an executable file, but it's the only Python file i have. And even when i add the correct path, (i at least don't get the exe error) but it still does not recognize pygame, however IDLE.app has no trouble importing pygame on it's own – Sebastian Navarro Aug 08 '15 at 16:20
  • IDLE is just an IDE. It uses a python executable to run python code. Did you try `which python3.4` from bash? – Håken Lid Aug 08 '15 at 16:28
  • Just so you know, a `.app` isn't an executable, it's just a fancy directory that runs an executable inside when you double click it. – DJMcMayhem Aug 08 '15 at 18:03

2 Answers2

1

I'm not on Mac right now, so I can't test this, but it looks like it can't find the correct Python interpreter. Fortunately, IDLE can find the correct python interpreter. Open IDLE and use:

import sys sys.executable

to find the correct python path to use. In your WingIDE settings, use that path.

Ben
  • 5,952
  • 4
  • 33
  • 44
  • Traceback (most recent call last): File "", line 1, in sys.exeutable AttributeError: 'module' object has no attribute 'exeutable' I keep getting this error, im assuming because macs don't use "EXE" files, unfortunately almost all of the support and tutorials are for Windows or Unix, and all I have are macs. (I do audio engineering work on the side) – Sebastian Navarro Aug 08 '15 at 16:05
  • 1
    `sys.executable` – it only works if you spell it correctly. If you are on a mac, you _are_ using Unix (OSX, to be precise). Many Linux tutorials can be used on a mac with very few changes, since a lot of stuff works the same under the hood – like the bash shell, which is identical on OSX and most Linux distros. – Håken Lid Aug 08 '15 at 16:20
  • Thank you so much, i got it all working now. After all my trials and errors, i wasn't expecting a spelling issue to be in the way at the end, feel kind of silly now haha – Sebastian Navarro Aug 08 '15 at 16:48
0

Basically Running This "import sys; print(sys.executable)" in the IDLE i already had working gave me the correct path to plug into Wing.

Everything runs beautifully now, Big thankyou to everyone who provided input to my problem and solution. Haken Lid & Ben