I'm trying to install some plugins for Ultimaker Cura but I'm hitting a wall with Python and pip. I've got Python version 3.11.2 and pip version 23.0.1 installed, but whenever I try to install the trimesh package using `pip install trimesh`, I get an error saying the environment is externally managed. The error suggests installing system-wide packages with `apt install`, or creating a virtual environment with `python3 -m venv`. However, when I try to run `sudo apt install pipx`, I get a 404 error regarding missing archives. What steps can I take to properly install my packages?
3 Answers
You could simply try installing the package directly with pipx if you can get it working. Just run `pipx install trimesh` or, as an alternative, you could try `sudo apt install python3-trimesh`. That might be simpler if you're running into installation issues with pip.
First off, try running `sudo apt update --fix-missing` and see if that resolves your package fetching issues. If you're still having problems, use a virtual environment to install the packages since it's more manageable. Just create one with `python3 -m venv /path/to/venv`, activate it, and then install your package using pip.
I did the `apt update --fix-missing` but still got 404s when trying to install pipx. Any other ideas?
A simpler solution is to stick with a virtual environment. It's a safe space for your Python packages, keeping them separate from your system Python. Just run:
```bash
python -m venv ~/venv
source ~/venv/bin/activate
pip install
```
Also, consider adding the source command to your .bashrc so you don't have to activate it every time!
I wanted to use pipx but my system won't let me install it, remember?