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 pyuserenv
Make sure to Configure the environment variables in your shell configuration file (e.g., .bashrc, .zshrc)
export USERENV_DIR="$HOME/.userenv" # default value, adapt to your needs
export PYTHONUSERBASE="$USERENV_DIR"
export PATH="$PATH:$USERENV_DIR/bin"
then reload your config
source ~/.bashrc # example for .bashrc
You're good to go !
userenv --help
Usage: userenv [OPTIONS] COMMAND [ARGS]...
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────╮
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell, to copy it or customize the │
│ installation. │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────╮
│ list │
│ create │
│ activate │
│ active │
│ deactivate │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyuserenv-1.0.2.tar.gz.
File metadata
- Download URL: pyuserenv-1.0.2.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d02b8262d4a522c540c351b5fa318463e0e3e58d72524c3211f35be5cc62bc1
|
|
| MD5 |
e835cc1ea945c9b98ab41390dbd8974f
|
|
| BLAKE2b-256 |
7798b96ca50d6e3e93ff149e6e68b06a1b290b9a9ed13c49396ee4b893947c22
|
Provenance
The following attestation bundles were made for pyuserenv-1.0.2.tar.gz:
Publisher:
python-publish.yml on pierreadorni/userenv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyuserenv-1.0.2.tar.gz -
Subject digest:
2d02b8262d4a522c540c351b5fa318463e0e3e58d72524c3211f35be5cc62bc1 - Sigstore transparency entry: 1409709926
- Sigstore integration time:
-
Permalink:
pierreadorni/userenv@173a0e62725a5f4ad4d72d56c6b09d496e83d62f -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/pierreadorni
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@173a0e62725a5f4ad4d72d56c6b09d496e83d62f -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyuserenv-1.0.2-py3-none-any.whl.
File metadata
- Download URL: pyuserenv-1.0.2-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
686e24f36204d4b080e05e507716e9d82c700db9d23dac37795ebafbaccfbe21
|
|
| MD5 |
cc24a4f06080f4db6434bbd5885594f7
|
|
| BLAKE2b-256 |
88677fb8376926392815772b9aad34ddd99f7b79b54cf38abfbba998b397e1be
|
Provenance
The following attestation bundles were made for pyuserenv-1.0.2-py3-none-any.whl:
Publisher:
python-publish.yml on pierreadorni/userenv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyuserenv-1.0.2-py3-none-any.whl -
Subject digest:
686e24f36204d4b080e05e507716e9d82c700db9d23dac37795ebafbaccfbe21 - Sigstore transparency entry: 1409709944
- Sigstore integration time:
-
Permalink:
pierreadorni/userenv@173a0e62725a5f4ad4d72d56c6b09d496e83d62f -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/pierreadorni
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@173a0e62725a5f4ad4d72d56c6b09d496e83d62f -
Trigger Event:
release
-
Statement type: