-2
User@Admins-MacBook-Pro ~ % pip install xq
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 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

If you get above error pip install xq .Try with below command :

sudo python3 -m pip install --upgrade --force-reinstall pip

brew install python --> install the latest Python.
ls -l /usr/local/bin/python* --> List all Python versions installed on your system.
ln -s -f /usr/local/bin/python[your-latest-version-just-installed] /usr/local/bin/python --> Change default Python version to the latest version.
E.g: ln -s -f /usr/local/bin/python3.9 /usr/local/bin/python
Restart terminal.
python --version --> Check Python version default again.
Ref: https://dev.to/malwarebo/how-to-set-python3-as-a-default-python-version-on-mac-4jjf

Like it if it helps you

2 Answers2

1

try the following in your mac terminal:

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

then:

pip install typing
taha maatof
  • 1,862
  • 2
  • 9
  • 23
0

From the docs:

For package maintainers, it is preferred to use typing;python_version<"3.5" if your package requires it to support earlier Python versions. This will avoid shadowing the stdlib typing module when your package is installed via pip install -t . on Python 3.5 or later.

xq might need python3 for smooth running, did not check it though. Maybe you can elaborate a little of your expectation in the question