Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
768 views
in Technique[技术] by (71.8m points)

python - Pip command line "ImportError: No Module Named Typing"

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

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

1 Reply

0 votes
by (71.8m points)

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

/usr/local/opt/[email protected]/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).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...