Home > OS >  How to install debian package into Python virtual environment: not in piwheels or pypi
How to install debian package into Python virtual environment: not in piwheels or pypi

Time:06-18

I want to use an open source py file in a project. This py file requires python3-usb and python3-setuptools niether of which are on pypi or piwheels. I get the following error when running a pip3 command in both cases:

ERROR: Could not find a version that satisfies the requirement python3-usb (from versions: none) ERROR: No matching distribution found for python3-usb

I have upgrade pip, my virtual envoronment is 3.9.2 and both pip and venv 'point' to venv/bin/python. The python3-usb package does not exist in piwheel or pypi (I haven't checked python3-setuptools). python3-usb exists in the debian package list python3-usb

Is it possible to install this package using pip3 ? Or failing that is there an alternative way of installing in the virtual environment ?

Thank you

CodePudding user response:

These two packages are not python packages and can not be installed using pip. You should install them using apt:

sudo apt install python3-usb python3-setuptools

CodePudding user response:

Debian has very strict naming conventions for their package names and thus tends to rename a lot of packages. The original name for python3-usb is pyusb, which is on pypi. As for setuptools, that's already installed into every venv by default.

  • Related