Skip to main content


#RaspberryPi OS Bookworm, released last week, brings a big change for Python users, as we implement a change introduced by the Python community in upstream Debian: from Bookworm onwards, packages installed via pip must be installed into a Python Virtual Environment using venv.

Cont...

in reply to Raspberry Pi :raspberrypi:

... This will affect a lot of people, and we understand it will be disruptive for many as we all get used to the new way of doing things. Our documentation about this aspect of using Python on Raspberry Pi is at rptl.io/venv; if you try to use pip the old way, you'll see an error message which includes that link. There, we set out exactly what you now need to do in order to install packages via pip.

https://www.raspberrypi.com/documentation/computers/os.html#python-on-raspberry-pi

in reply to Raspberry Pi :raspberrypi:

Why though? This breaks so many existing tutorials and will add unnecessary confusion for newcomers. It's bad usability and lots of people will give up on learning raspberry pi just because of this change.
in reply to Raspberry Pi :raspberrypi:

I do like this idea. Installing packages straight into the system Python env can cause all sorts of troubles, and enforcing venvs is enforcing good, safe practices.
in reply to Raspberry Pi :raspberrypi:

definitely late to this thread, but for those who don't want to deal with python venvs (and rightfully so - they suck), the quick and easy solution is to add --break-system-packages to pip install commands, or by adding the following to ~/.config/pip/pip.conf:


[global]break-system-packages = true

Lo, thar be cookies on this site to keep track of your login. By clicking 'okay', you are CONSENTING to this.