7

Running the Command gives me the following error:

C:\Python34\Scripts> pip install pygame

Error Stack :

Traceback (most recent call last):
  File "C:\Python34\lib\runpy.py", line 171, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python34\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python34\Scripts\pip.exe\__main__.py", line 5, in <module>
  File "C:\Python34\lib\site-packages\pip\__init__.py", line 1, in <module>
    from typing import List, Optional
ImportError: No module named 'typing'
Fourier
  • 2,097
  • 1
  • 19
  • 31
Rydex
  • 77
  • 1
  • 1
  • 5
  • 3
    Python 3.4 was released over 7 years ago and has already reached end-of-life. Current versions of `pip` might not support Python 3.4 anymore. – Matthias Apr 27 '21 at 06:41

4 Answers4

4

pip3 install worked for me . Thanks Dragoslav for ending my frustration .

Batuhan14
  • 41
  • 1
3

Running this line in 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 you have to use to aforementioned command(s).

gatorcoder
  • 53
  • 4
2

It looks like you are importing from the package 'typing' but you do not have it installed. Try installing the package:

pip install typing
S. A.
  • 92
  • 7
  • 3
    A much better fix is to upgrade to a recent Python version which has it included in the standard library. Chances are the library you are trying to use won't work very well in 3.4 either. – tripleee Apr 27 '21 at 07:37
  • 2
    in the question pip itself is failing as it tries to import typing and typing is not installed. so you cannot run pip install to fix this. e.g. redhat run `yum install python-typing` However, the real problem might be that python packages are upgraded to python3.? and pip is running python2 so ... heh, ... – gaoithe May 18 '21 at 11:28
1

Try this one:

pip3 install pygame

Dragoslav
  • 19
  • 1