[Python] "python setup.py install" does not install inside virtualenv

Discussão em 'Python' iniciado por Stack, Junho 18, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to install a python package using setup.py in virtualenv with Python 2.7. The requirement is package and it's dependencies should go inside site-package folder of virtualenv path.

    So I activated virtualenv and went to location where setup.py is present. But when I run python setup.py install, the package and it's dependencies gets installed inside system python site-package.

    In order to install it inside virtualenv I had to specify the location of python inside virtualenv like <virtualenv path>/bin/python setup.py install. This looks strange to me given the virtualenv is already activated. Is this the correct way of installation using setup.py inside virtualenv? If yes then why? If not what is the correct way of doing it?

    Edit:

    I ran which python and it pointed to location of python inside virtualenv.

    I am using centos 6 machine.

    Continue reading...

Compartilhe esta Página