Forums

Pip3.5 syntax error in Virtualenv

After installing a new virtualenv with python 3.5, pip3.5 generates a syntax error.

Traceback (most recent call last):
  File "/home/eltgi/.virtualenvs/apartment_venv/bin/pip3.5", line 7, in <module>
    from pip._internal.cli.main import main
  File "/home/eltgi/.virtualenvs/apartment_venv/lib/python3.5/site-packages/pip/_internal/cli/main.py", line 57
    sys.stderr.write(f"ERROR: {exc}")

You have an f-string in your code -- f-strings were introduced in Python 3.6, so it won't work in 3.5.

The error comes when I tried "pip3.5 install bottle", this is not my code.

Right, it's pip that is broken. You're using very old system image, I'd suggest upgrading to more recent one, where that should work (I was just able to install bottle in a venv for Python 3.5 without any issues on the most recent system image). See: https://help.pythonanywhere.com/pages/ChangingSystemImage/.