Forums

invalid syntax from calling pip3 from console

I wanted to upgrade my system image from fishandchips to haggis. I'm running python 3.8 on both. Flask no longer works. As part of the troubleshooting, I thought I'd investigate the packages with pip3, however, all pip3 calls from the console results in the following (sorry for formatting):

14:50 ~ $ pip3 --version

Traceback (most recent call last): File "/home/{user}/.local/bin/pip3", line 5, in <module> from pip._internal.cli.main import main

File "/usr/local/lib/python3.8/dist-packages/pip/_internal/cli/main.py", line 9, in <module> from pip._internal.cli.autocompletion import autocomplete

File "/usr/local/lib/python3.8/dist-packages/pip/_internal/cli/autocompletion.py", line 10, in <module> from pip._internal.cli.main_parser import create_main_parser

File "/usr/local/lib/python3.8/dist-packages/pip/_internal/cli/main_parser.py", line 8, in <module> from pip._internal.cli import cmdoptions

File "/usr/local/lib/python3.8/dist-packages/pip/_internal/cli/cmdoptions.py", line 23, in <module> from pip._internal.cli.parser import ConfigOptionParser

File "/usr/local/lib/python3.8/dist-packages/pip/_internal/cli/parser.py", line 12, in <module> from pip._internal.configuration import Configuration, ConfigurationError

File "/usr/local/lib/python3.8/dist-packages/pip/_internal/configuration.py", line 27, in <module> from pip._internal.utils.misc import ensure_dir, enum

File "/usr/local/lib/python3.8/dist-packages/pip/_internal/utils/misc.py", line 38, in <module> from pip._vendor.tenacity import retry, stop_after_delay, wait_fixed

File "/usr/local/lib/python3.8/dist-packages/pip/_vendor/tenacity/init.py", line 520, in <module> from pip._vendor.tenacity._asyncio import AsyncRetrying

File "/usr/local/lib/python3.8/dist-packages/pip/_vendor/tenacity/_asyncio.py", line 19, in <module> from asyncio import sleep

File "/home/{user}/.local/lib/python3.8/site-packages/asyncio/init.py", line 21, in <module> from .base_events import *

File "/home/{user}/.local/lib/python3.8/site-packages/asyncio/base_events.py", line 296 future = tasks.async(future, loop=self) ^

SyntaxError: invalid syntax

That looks like you have somehow installed broken packages into your .local diretory. Delete ~/.local/lib/python3.8 and everything should work again.

I was finally able to implement the fix, and I wanted to report that this indeed did work. Thank you very much!

Thanks for letting us know!