0

I made Virt2 virtual environment.
using $ python -m venv Virt2.

I want to install my custom packages in "site-packages" directory. However packages are installed in "dist-packages" directory.

enter image description here

what should I do to install packages in my python virtual environment site-packages??


my python version 3.6.2 (in /usr/local/bin)

Harsha Biyani
  • 7,049
  • 9
  • 37
  • 61
newbie16
  • 767
  • 5
  • 13
  • 23
  • You are telling that your python version is 3.6 and the package is in 3.4.May be this is due to the different versions of python – Poorna Prudhvi Sep 11 '17 at 09:27
  • why their version is not the same?? what should I do to enforce same version? – newbie16 Sep 11 '17 at 09:30
  • you should specify the Python version while creating your python environment.checkout answers in https://stackoverflow.com/questions/23842713/using-python-3-in-virtualenv – Poorna Prudhvi Sep 11 '17 at 09:33

1 Answers1

1

You use sudo and sudo switches user to root, i.e. you're completely outside of you virtual env. System pip3 outside of virtual env installs packages into a system directory which is dist-packages.

Run pip install inside you virtual env without sudo.

phd
  • 82,685
  • 13
  • 120
  • 165