I did some more research on this, and I think I finally understand what’s going on.
The “externally-managed-environment” error almost always means pip is still using the system Python instead of the virtual environment that App Lab creates. That would also explain why evdev shows up in pip list, but App Lab still can’t import it.
So the important part is to make sure you’re actually inside the App Lab venv before installing anything.
Here’s the exact sequence that should work:
Go to your App Lab project directory
cd /home/arduino/<your_app_name>
- Activate the venv created by App Lab
source .cache/.venv/bin/activate
3.Make sure the activation really worked
Run:
which python
which pip
You should see something like:
/home/arduino/<your_app_name>/.cache/.venv/bin/python
/home/arduino/<your_app_name>/.cache/.venv/bin/pip
If it still shows /usr/bin/python3 or /usr/bin/pip3,
then the venv didn’t activate correctly — and pip will refuse to install anything.
4.Once pip is pointing to the venv, install evdev
pip install evdev
Now it should install cleanly inside the venv, not system-wide.
5.(Optional) Verify that evdev is installed inside the venv
pip list
You should see:
evdev 1.9.1
Inside the venv environment — which means App Lab can now import it.
I’m not 100% certain because I can’t see your filesystem,
but based on everything I found, this seems to be the correct way to install packages that App Lab will actually see.
If you want, you can paste the output of which python after activation, and I can confirm immediately whether you're in the right environment.
I think you should go get help from AI because I might have missed something or if you have any other questions, I'd be happy to help you.