Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Actually, I wanted to create my first Django project. After I did some coding in the cmd, I opened the code using Visual Studio Code.

I selected the Python interpreter on the status bar, and then I changed it to the Python interpreter installed in my digital environment. After that, I got message that linter Pylint was not installed. After I installed that, these errors occurred.

Enter image description here

like image 708
syakirin Avatar asked Sep 10 '25 16:09

syakirin


2 Answers

This solution worked for me. I am just repeating it here:

  1. Go to the pyvenv.cfg file in the Virtual environment folder
  2. Set the include-system-site-packages to true and save the change
  3. Reactivate the virtual environment.
like image 155
Joel Oduro-Afriyie Avatar answered Sep 13 '25 05:09

Joel Oduro-Afriyie


I did encounter the same error when I wanted to install a Python module.This is because you want to install a user-specific module in your project, and the virtual environment user-site packages are not visible. The --user installs a Python package for the current user rather than the users of the system. You can use this:

pip install <Python package>

instead of pip install --user <python package>.

like image 36
Paul Munyao Avatar answered Sep 13 '25 05:09

Paul Munyao