Gitpod: ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.

Created on 14 Oct 2020  路  3Comments  路  Source: gitpod-io/gitpod

Describe the bug

Not able to install python packages inside a virtualenv.

Steps to reproduce

  1. Open https://gitpod.io/#https://github.com/tekumara/typed-cookie
  2. Source the venv: . venv/bin/activate
  3. pip install pytest

Expected behavior

The python package is installed into the virtualenv

Additional information

(venv) gitpod /workspace/typed-cookie $ pip install pytest
ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
WARNING: You are using pip version 20.2.1; however, version 20.2.3 is available.
You should consider upgrading via the '/workspace/typed-cookie/venv/bin/python3 -m pip install --upgrade pip' command.

Example repository

https://github.com/tekumara/typed-cookie

bug python

All 3 comments

In Gitpod, the environment variable PIP_USER is set to yes. That's why it runs pip with the user flag --user which does not work in a virtualenv. As a workaround, you could run

$ export PIP_USER=false

and pip install ... in a virtualenv works again.

@tekumara please make sure to store the packages of your virtual envs under /workspace, in order to preserve them at workspace restart, or for prebuilds.

currently, only the /workspace location is backed up. this limitation will be removed in a future release.

Has this issue been resolved and can be closed?

Was this page helpful?
1 / 5 - 1 ratings

Related issues

iksaif picture iksaif  路  3Comments

kittaakos picture kittaakos  路  3Comments

LezaiNiubi picture LezaiNiubi  路  3Comments

ColbyWTaylor picture ColbyWTaylor  路  3Comments

mouse484 picture mouse484  路  3Comments