"python setup.py install" is not installed inside virtualenv

I am trying to install a python package using setup.pyin virtualenvwith Python 2.7. A requirement is a package, and its dependencies should go into the path package site folder virtualenv.

So, I activated virtualenvand moved to the place where it is present setup.py. But when I run python setup.py install, the package and its dependencies are installed inside the package of the python system site.

To install it in virtualenv, I had to specify the location of the python inside virtualenv as <virtualenv path>/bin/python setup.py install. This looks weird to me since virtualenv is already activated. Is this the correct installation method using setup.py inside virtualenv? If so, why? If this is not the right way to do this?

Edit:

I ran which pythonand pointed to the location of the python inside virtualenv.

I am using a centos 6 machine.

+4
source share
2 answers

Related Package Sites

Virtualenv can associate its site package catalog with global site packages. On the man page (mine 1.5.2):

--no-site-packages    Don't give access to the global site-packages dir
                      to the virtual environment

In version 1.5.2, this binding is the default and you need to specify otherwise when creating the environment. In future versions, this behavior has been switched so that the link is NOT the default behavior.

What to do:

, <environment>/lib/python<ver>/no-global-site-packages.txt. , - , , virtualenv , , , , . virtualenv --no-site-packages .

0

py2.7 setup.py,

from distutils.core import setup

virtualenv (CENTOS 6.0 --no-site-packages) .

,

from setuptools import setup

.

. , - .

0

Source: https://habr.com/ru/post/1624940/


All Articles