Skip to content

Add alternative to pip3 install of cargo lambda #981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Bryson14
Copy link
Contributor

@Bryson14 Bryson14 commented May 4, 2025

Another way to manage executable pip packages is with uv which has been very popular and helpful in the python community.


📬 *Issue #, if available:*

Small issue, When running `pip3 install .....` it shows this error about system vs user installation:

rror: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.

See /usr/share/doc/python3.12/README.venv for more information.

✍️ *Description of changes:*

Experienced python users might already know that they can use `uv` to install and load python packages from pip as executable. But for those that don't know, adding this line can be a helpful alternative that doesn't show installation errors, reducing any friction to rust or python developers.

🔏 *By submitting this pull request*

- [x] I confirm that I've ran `cargo +nightly fmt`.
- [x] I confirm that I've ran `cargo clippy --fix`.
- [x] I confirm that I've made a best effort attempt to update all relevant documentation.
- [x] I confirm that my contribution is made under the terms of the Apache 2.0 license.

When running `pip3 install .....` it shows this error about system vs user installation:

```
rror: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.12/README.venv for more information.

```

Another way to manage executable pip packages is with uv which has been very popular and helpful in the python community.

```
@calavera
Copy link
Contributor

calavera commented May 4, 2025

Uv is great, but it’s not as standard as pip, so at least, you’d have to explain how to install Uv first. The paragraph below already has a link with additional installation methods, it might be better to pick from that list:

https://www.cargo-lambda.info/guide/installation.html

Installation scripts is probably what people are more used to which can be found here:

curl -fsSL https://cargo-lambda.info/install.sh | sh

For Windows/Powershell specifically:

irm https://cargo-lambda.info/install.ps1 | iex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants