How to install python modules based on each project, and not on the whole system?

I am trying to determine the process of porting django projects from my development server to my production server using git, and it drives me crazy that distutils installs python modules at system scale. I read the documentation, but if I am missing something, it seems mainly about how to change the installation directory. I need to be able to use different versions of the same module in different projects running on the same server, and deploy projects from git without the need to download and install dependencies.

tl; dr: I need to know how to install python modules using distutils in my source project tree for version control without affecting other projects using different versions of the same module.

I am new to python, so I apologize in advance if this is common knowledge.

+3
source share
3 answers

You may be looking for virtualenv . This will allow you to install packages in a separate virtual "root" of Python.

+3
source

virtualenv, , , Distutils . , home scheme, " Python-". Python .

+3

for completeness, virtualenvwrapper works with virtualenv every day much faster and easier when you work on several projects and / or on multiple development platforms at the same time.

+1
source

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


All Articles