# Adafruit servo board: pip3 error: externally-managed environment

**URL:** <https://forum.core-electronics.com.au/t/adafruit-servo-board-pip3-error-externally-managed-environment/20456>\
**Category:** Raspberry Pi\
**Created:** [15 July 2024 12:24 UTC](https://forum.core-electronics.com.au/t/adafruit-servo-board-pip3-error-externally-managed-environment/20456 "2024-07-15T12:24:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin275131](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@martin275131](https://forum.core-electronics.com.au/u/martin275131)\
**Post date:** [15 July 2024 12:24 UTC](https://forum.core-electronics.com.au/t/adafruit-servo-board-pip3-error-externally-managed-environment/20456/1 "2024-07-15T12:24:16Z")

</div>

Hello,  
I am new to linux and python and want to control servos with Adafruit 16-Channel Servo HAT for Raspberry Pi. I have Raspi 3b+ with recommended 64bit system

I am trying to get according to Tims tutorial [https://core-electronics.com.au/guides/servo-hat-raspberry-pi/](https://core-electronics.com.au/guides/servo-hat-raspberry-pi/). When executing **sudo pip3 install adafruit-circuitpython-servokit** I get a error:  
error: externally-managed-environment

I tried to find the issue on stack overflow and tried some suggested solutions using pipx or venv, but wihtout success. Is there any other way how to install this servokit?

Thank you very much,  
Martin.

---

<div class="post-metadata">

**Author:** ![lia262073](https://avatars.discourse-cdn.com/v4/letter/l/94ad74/32.png) [@lia262073](https://forum.core-electronics.com.au/u/lia262073)\
**Post date:** [15 July 2024 16:16 UTC](https://forum.core-electronics.com.au/t/adafruit-servo-board-pip3-error-externally-managed-environment/20456/2 "2024-07-15T16:16:50Z")

</div>

> [@martin275131](#):
>
> I am new to linux and python and want to control servos with Adafruit 16-Channel Servo HAT for Raspberry Pi. I have Raspi 3b+ with recommended 64bit system
> 
> I am trying to get according to Tims tutorial [https://core-electronics.com.au/guides/servo-hat-raspberry-pi/](https://core-electronics.com.au/guides/servo-hat-raspberry-pi/). When executing **sudo pip3 install adafruit-circuitpython-servokit** I get a error:  
> error: externally-managed-environment
> 
> I tried to find the issue on stack overflow and tried some suggested solutions using pipx or venv, but wihtout success. Is there any other way how to install this servokit?

You can use the `--break-system-packages` Flag

```auto
sudo pip3 install adafruit-circuitpython-servokit --break-system-packages

```

---

<div class="post-metadata">

**Author:** ![James46717](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@James46717](https://forum.core-electronics.com.au/u/James46717)\
**Post date:** [16 July 2024 00:07 UTC](https://forum.core-electronics.com.au/t/adafruit-servo-board-pip3-error-externally-managed-environment/20456/3 "2024-07-16T00:07:08Z")

</div>

error: externally-managed-environment is related to Bookworm OS, it needs a virtual environment setup.

It should work ok with Bullseye OS.

Cheers  
Jim

---

<div class="post-metadata">

**Author:** ![Michael](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/michael/32/3545_2.png) [@Michael](https://forum.core-electronics.com.au/u/Michael)\
**Post date:** [16 July 2024 06:08 UTC](https://forum.core-electronics.com.au/t/adafruit-servo-board-pip3-error-externally-managed-environment/20456/4 "2024-07-16T06:08:43Z")

</div>

Hey! we have a guide on how to setup a virtual environment here using Thonny - you may find that helps in creating the environment. If you install your packages from within the thonny package manager you should be good to go 🙂

> **[Using Virtual Environments in Thonny on a Raspberry Pi - Tutorial Australia](https://core-electronics.com.au/guides/raspberry-pi/using-virtual-environments-in-thonny-on-a-raspberry-pi/)**
>
> This is a quick crash course on how to set up, use, and change virtual environments in Thonny on a Raspberry Pi.
> In late 2023 Bookworm OS for the Raspberry Pi rolled out and this new OS restricted the ability to install externally managed packages...
