-1

I'm wondering how to install pybluez library in a Python virtual environment (Linux Ubuntu / Pop! OS).

The problem is simple: there's no bluetooth.h header in the virtual environment, so it fails during installation.

In real environment there's a series of libraries to install to do the work, but I'm unable to do the same in a virtual environment.

sinoroc
  • 18,409
  • 2
  • 39
  • 70
Hammeronthenet
  • 132
  • 2
  • 14

2 Answers2

0

You will need to have the bluetooth.h file and the bluez development files available on the system at all (headers and system libraries are never in virtualenvs anyway).

On Ubuntu, apt install libbluetooth-dev should probably do the trick.

AKX
  • 152,115
  • 15
  • 115
  • 172
  • Thank you for your answer, but I think the problem is another: tomorrow I'll post here a solution. It seems the real proble is PyCharm IDE that is installed as flatpak. So it's unable to see underlying libraries (libbluetooth for example). I'm testing... – Hammeronthenet Jan 02 '21 at 21:12
  • You would need a Python interpreter in the same filesystem (or at least be able to read the same filesystem as) where the headers and libraries are, yes. Pycharm doesn't ship an interpreter though. – AKX Jan 03 '21 at 14:04
0

I want to ask to myself cause the problem was really singular and I think that someone else could be involved: the problem is that PyCharm IDE was installed through flatpack. So (I don't know the details cause I'm not an expert about this package format) the program run in a sort of vm and it's unable to recognize libraries under the "real" system. Imho this kind of software (ide I mean) should be inatalled directly with a "classic".deb package to avoid problems like this.

Hammeronthenet
  • 132
  • 2
  • 14