Closed rjblake closed 3 years ago
Hi @rjblake
do you try to run Python 3.9 in a virtual environment? Do you have it completely installed? I think I had similiar errors when trying to run it from an additionally compiled version. Installing it completely and then installing
pip3 install bluepy pybluez
fixed it.
Without completly installing it, I was not able to install these 2 Python packages without any error.
I installed Python 3.9 on the Raspberry Pi (using instructions to build here https://gist.github.com/SeppPenner/6a5a30ebc8f79936fa136c524417761d. i.e. built from source
I also installed bluepy and pybluez doing the following:
pi@raspi:~/MiTemperature2 $ sudo pip3.9 install bluepy pybluez Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Requirement already satisfied: bluepy in /usr/local/lib/python3.9/site-packages (1.3.0) Requirement already satisfied: pybluez in /usr/local/lib/python3.9/site-packages (0.23)
and it reports as installed. When you say 'installing it completely', any suggestions
I don't know what exactly is the problem with Python, but I had the same problem. As soon as normal python is newer version it works.
Instead of sudo make altinstall
do try sudo make install
I run on Python 3.9.1 compiled from source and it worked as soon it was installed over existing Python version.
@JsBergbau - thanks for the tip. Doing an install
instead of altinstall
appears to have fixed this. Wish there were cleaner ways of managing Python version as I've now I've got v2.7.x, v3.4.4, v3.5.3, v3.6.12, v3.9.1 - and still sometimes it'll pick 3.5.3 as default python3 despite having used sudo update-alternatives --config python
to use v3.9.1 - guess I've missed something somewhere
Sorry to necro this, but for future travellers you need to have Python built with Bluetooth socket support. This should happen automatically if you make sure that you have bluetooth/bluetooth.h
available before you build/install Python. It may not be available in your installation's default Python if Python was installed before the bluetooth lib. This can be installed like so:
sudo apt-get install libbluetooth-dev
# OR
sudo yum install bluez-libs-devel
Once the bluetooth libs are installed, then reinstall Python.
@cloventt what is the solution for macos system? apt-get and yum doesn't work on mac. I also cannot find brew nor macport packages named "libbluetooth-dev".
same question but for windows, what's the workaround here? Also, it seems like bluepy is linux-only.
I've just installed and it runs normally, unless I select ATC mode (
I'm a bit lost on this and appreciate any suggestions. Some additional info as follows: