0

I'm very new to Python and Python3; I've only been getting into it for maybe a week now, if that. I know I need to use something called pip or pip3 to install packages like Flask. But every time I've tried to use those commands, I've received an error message saying the command pip wasn't found. So, I typed pip --version to see if I have it on my computer or not, and I received the following error stack:

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 11, in <module>
    load_entry_point('pip==21.1.2', 'console_scripts', 'pip')()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2843, in load_entry_point
    return ep.load()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2434, in load
    return self.resolve()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2440, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/Library/Python/2.7/site-packages/pip-21.1.2-py2.7.egg/pip/__init__.py", line 1, in <module>
    from typing import List, Optional
ImportError: No module named typing

In the research that I've done, I haven't found a way to fix this error, but I'm guessing this means I need to install a package called typing. Is this something I want or should install on my system, or just the project on which I'm working?

Holger Mueller
  • 372
  • 1
  • 6
  • 16
  • ```pip install typing``` Install typing and try again –  Jun 11 '21 at 16:54
  • 1
    How can they do that if `pip` crashes? – Tim Roberts Jun 11 '21 at 17:15
  • 1
    You're using the MacOS-installed version of Python 2 here. For your mental health, I suggest you start using `python3` and `pip3` instead. Python 2 is obsolete. You can use aliases to make `python` map to `python3`. – Tim Roberts Jun 11 '21 at 17:22
  • https://stackoverflow.com/search?tab=newest&q=%5bpip%5d%20ImportError%3a%20No%20module%20named%20typing – phd Jun 11 '21 at 18:20

0 Answers0