-
Notifications
You must be signed in to change notification settings - Fork 0
Installing with Pip inside your pipenv project
This guide explains how to properly install and manage dependencies for the Ui-Py project using Pipenv.
Pipenv combines pip and virtual environments into a single tool that manages dependencies in a deterministic way. It creates a Pipfile and Pipfile.lock that ensure consistent installations across different environments.
Sometimes you may need to install packages directly from GitHub or other Git repositories. Here's how to do it properly with Pipenv:
When installing dependencies from Git repositories, use pipenv directly to ensure they're properly tracked in your virtual environment:
# Navigate to your project directory first
cd path/to/Ui-Py
# Install a package from a Git repository
pipenv install git+https://github.com/username/repo-name@branch#egg=package-nameExample:
pipenv install git+https://github.com/Rapptz/discord-ext-menus@master#egg=discord-ext-menusThis command:
- Downloads the package from the Git repository
- Installs it in your virtual environment
- Updates your Pipfile and Pipfile.lock to track the dependency
While you can use pip directly, this approach isn't recommended as it doesn't update your Pipfile:
pip install -U git+https://github.com/username/repo-nameTo add regular PyPI packages to your project:
pipenv install package-nameFor development dependencies (like linters or testing tools):
pipenv install --dev package-nameTo update all dependencies to their latest versions according to your Pipfile:
pipenv updateIf you've manually edited your Pipfile or want to ensure all dependencies are locked:
pipenv lockTo ensure you get exactly the same versions of packages that are specified in the lock file:
pipenv syncIf you need a requirements.txt file (for Docker builds, etc.):
pipenv requirements > requirements.txt