Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Running the following command gives me the following error:

pip install pygame

Error Stack:

Traceback (most recent call last):
  File "C:Python34lib
unpy.py", line 171, in _run_module_as_main
    "__main__", mod_spec)
  File "C:Python34lib
unpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:Python34Scriptspip.exe\__main__.py", line 5, in <module>
  File "C:Python34libsite-packagespip\__init__.py", line 1, in <module>
    from typing import List, Optional
ImportError: No module named 'typing'
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
835 views
Welcome To Ask or Share your Answers For Others

1 Answer

Running this line in a Mac terminal fixed it for me:

/usr/local/opt/python@3.9/bin/python3.9 -m pip install --upgrade pip

I had the same issue. I also first tried the pip3 install pygame which was previously mentioned, before running this line. You may have to do that first. For the individual who said to try

pip install typing

that line of code will simply produce the same error. To fix it, you have to use to the aforementioned command(s).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...