Search code examples
pythonpython-2.7piprequirements.txt

Installing Python Dependencies locally in project


I am coming from NodeJS and learning Python and was wondering how to properly install the packages in requirements.txt file locally in the project.

For node, this is done by managing and installing the packages in package.json via npm install. However, the convention for Python project seems to be to add packages to a directory called lib. When I do pip install -r requirements.txt I think this does a global install on my computer, similar to nodes npm install -g global install. How can I install the dependencies of my requirements.txt file in a folder called lib?


Solution

  • use this command
    pip install -r requirements.txt -t <path-to-the-lib-directory>