Forums

pip broken in new virtualenv

Hi, I created a new virtual environment for a new web app but pip seems to be broken inside it. Inside of other environments its fine, no environments is fine. Google isn't helping. Any thoughts?

06:01 ~/delaney$ mkvirtualenv delaney_venv --python=/usr/bin/python3.5                                                                                                                                           
Running virtualenv with interpreter /usr/bin/python3.5
Using base prefix '/usr'
New python executable in /home/user_name/.virtualenvs/delaney_venv/bin/python3.5
Also creating executable in /home/user_name/.virtualenvs/delaney_venv/bin/python
Installing setuptools, pip, wheel...done.
virtualenvwrapper.user_scripts creating /home/user_name/.virtualenvs/delaney_venv/bin/predeactivate
virtualenvwrapper.user_scripts creating /home/user_name/.virtualenvs/delaney_venv/bin/postdeactivate
virtualenvwrapper.user_scripts creating /home/user_name/.virtualenvs/delaney_venv/bin/preactivate
virtualenvwrapper.user_scripts creating /home/user_name/.virtualenvs/delaney_venv/bin/postactivate
virtualenvwrapper.user_scripts creating /home/user_name/.virtualenvs/delaney_venv/bin/get_env_details
(delaney_venv) 06:02 ~/delaney$ pip
Traceback (most recent call last):
  File "/home/user_name/.virtualenvs/delaney_venv/bin/pip", line 7, in <module>
    from pip._internal.cli.main import main
  File "/home/user_name/.virtualenvs/delaney_venv/lib/python3.5/site-packages/pip/_internal/cli/main.py", line 60
    sys.stderr.write(f"ERROR: {exc}")
                                   ^
SyntaxError: invalid syntax
(delaney_venv) 06:02 ~/delaney$

Your account is using quite an old system image. It comes from the days when all the pip3 versions were the same. Since then, pip has separated the versions that work in Python 3.6+ and those for up to 3.5. You're getting a version of pip that is meant for Python 3.6 and so it doesn't work in 3.5.

We can update your system image, but note that switching to the new image may break some of your existing code that worked on older versions. You may need to recreate any virtualenvs that you're using and you will need to start new consoles and reload your web apps. You will also need to kill any ipython notebook processes that are running by using the "Fetch processes" button on the Consoles page.

Hi Glenn, thanks for the feedback. Can you schedule an upgrade to the current system image? All my apps are on python 3.5 and django 2.2.9 so I think there should be no version issues.

Please let me know what time this will take place and I can be available to get the apps running again. Thanks,

Thanks. Can we schedule an upgrade to the current image to fix that? If you can let me know what time that would be awesome. (Edit - sorry for the double post, something didn't delete or cache properly)

We can schedule the update any time between 11am and 6pm UTC on a weekday. Let us know what time in that range works for you and we'll do it then.

11am - 3pm UTC any day would be an excellent window. That would give me some time before users would start using the app again. Thx, Matt

No problem. I have scheduled it for 10 Feb at 11am. We'll drop you an email when it's done.