0
votes

I'm a beginner, I have really hit a brick wall, and would greatly appreciate any advice someone more advanced can offer.

I have been having a number of extremely frustrating issues the past few days, which I have been round and round google trying to solve, tried all sorts of things to no avail.

Problem 1)

I can't import pygame in Idle with the error:

ModuleNotFoundError: No module named 'pygame' - even though it is definitely installed, as in terminal, if I ask pip3 to install pygame it says:

Requirement already satisfied: pygame in /usr/local/lib/python3.7/site-packages (1.9.4)

I think there may be a problem with several conflicting versions of python on my computer, as when i type sys.path in Idle (which by the way displays Python 3.7.2 ) the following are listed:

'/Users/myname/Documents', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python37.zip', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload', '/Users/myname/Library/Python/3.7/lib/python/site-packages', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages'

So am I right in thinking pygame is in the python3.7/sitepackages version, and this is why idle won't import it? I don't know I'm just trying to make sense of this. I have absoloutely no clue how to solve this,"re-set the path" or whatever. I don't even know how to find all of these versions of python as only one appears in my applications folder, the rest are elsewhere?

Problem 2)

Apparently there should be a python 2.7 system version installed on every mac system which is vital to the running of python regardless of the developing environment you use. Yet all of my versions of python seem to be in the library/downloaded versions. Does this mean my system version of python is gone? I have put the computer in recovery mode today and done a reinstall of the macOS mojave system today, so shouldn't any possible lost version of python 2.7 be back on the system now?

Problem 3)

When I go to terminal, frequently every command I type is 'not found'.

I have sometimes found a temporary solution is typing:

export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

but the problems always return!

As I say I also did a system reinstall today but that has helped none!

Can anybody please help me with these queries? I am really at the end of my tether and quite lost, forgive my programming ignorance please. Many thanks.

1
Just don't use Idle. At all. Your system python is almost certainly still there but there's not much point in thinking about it or trying to use it. You should check out the site's intro docs and then write specific questions on your specific issues. - pvg
Yes I have re-written the question more clearly and more specifically. And re-posted. But what do you recommend i use if not IDLE? - marlena
You can use one of the many free editors available. Anyway, you should still review the docs about how to ask questions and what topics are, well, on-topic. - pvg

1 Answers

0
votes

Try it with the problem1 I'm not an expert neither, but I think you need to install both in terminal and python in order to use the program.

python -m pip install pygame