Skip to main content

A Python library for managing user-installed package lists.

Project description

UserEnv: User Installed Modules Manager

Do you work on a system where python environments are pre-configured, and your only way to add custom modules is using pip install --user ? UserEnv allows you to keep multiple sets of user packages in a single python environment, as user environments.

A Concrete Example

Let's say you need to use both NumPy-1 and NumPy-2 in the same environment. First, create a userenv for NumPy-1:

$ userenv create numpy1 && userenv activate numpy1
User environment 'numpy1' created at /home/adorni/.userenv/envs/numpy1.
User environment 'numpy1' activated.

$ pip install --user numpy==1.26.4
...
Successfully installed numpy-1.26.4

Then, create a userenv for NumPy 2:

$ userenv create numpy2 && userenv activate numpy2
User environment 'numpy2' created at /home/adorni/.userenv/envs/numpy2.
User environment 'numpy2' activated.

$ pip install --user numpy==2.4.4
...
Successfully installed numpy-2.4.4

Et voilà ! You can now use both versions of numpy the same way you would use a normal venv:

$ userenv activate numpy1 && python -c "import numpy; print(numpy.__version__)"
User environment 'numpy1' activated.
1.26.4

$ userenv activate numpy2 && python -c "import numpy; print(numpy.__version__)"
User environment 'numpy2' activated.
2.4.4

Installation

$ pip install --user pyuserenv
$ userenv setup

Make sure to follow the setup instructions with the modifications to your shell configuration file (e.g., .bashrc, .zshrc), then reload your config

source ~/.bashrc # example for .bashrc

You're good to go !

$ userenv --help

 Usage: userenv [OPTIONS] COMMAND [ARGS]...

╭─ Options ─────────────────────────────────────────────────────────╮
│ --version  -v        Show the version of pyuserenv                │
│ --help               Show this message and exit.                  │
╰───────────────────────────────────────────────────────────────────╯
╭─ Commands ────────────────────────────────────────────────────────╮
│ list        List all user environments with their installed       │
│             module count and last installed module datetime.      │
│ create      Create a new user environment.                        │
│ activate    Activate a user environment.                          │
│ active      Display the currently active user environment.        │
│ deactivate  Deactivate the currently active user environment.     │
│ setup       Setup the user environment directory structure.       │
│ delete      Delete an existing user environment.                  │
╰───────────────────────────────────────────────────────────────────╯

Contributing

Feel free to submit pull requests and file bugs in the issue tracker.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyuserenv-1.1.1.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyuserenv-1.1.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file pyuserenv-1.1.1.tar.gz.

File metadata

  • Download URL: pyuserenv-1.1.1.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyuserenv-1.1.1.tar.gz
Algorithm Hash digest
SHA256 1f0decabb9a827d2797cb8ad7f082f0502a9c5c54a741bc41245fa5dee1b4de1
MD5 103a3b0340213676bcfea9df162a811e
BLAKE2b-256 10446e41824036f83e003e58a6e05112c41ae6a5c186e346e70c597a9604fc04

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyuserenv-1.1.1.tar.gz:

Publisher: python-publish.yml on pierreadorni/userenv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyuserenv-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyuserenv-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyuserenv-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 72554e668e1574a5a5c179591279bdc39a54caf8fc624ee5fe39bfbf36984bc6
MD5 2c9b5899cec4dc2e6bbb39d3cc77ecc2
BLAKE2b-256 e4b2ae7dca83e07ff4b038be89e195010c4835c9d5693b68710c335969cadd4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyuserenv-1.1.1-py3-none-any.whl:

Publisher: python-publish.yml on pierreadorni/userenv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page