Skip to content
This repository was archived by the owner on Nov 12, 2019. It is now read-only.

Python 3 support #13

Closed
tipa opened this issue Mar 1, 2015 · 18 comments
Closed

Python 3 support #13

tipa opened this issue Mar 1, 2015 · 18 comments

Comments

@tipa
Copy link

tipa commented Mar 1, 2015

Is Python 3 support planned or already on its way?

@bennuttall
Copy link

+1

@NucleaPeon
Copy link

Python3 support would be greatly appreciated.

@iorbitearth
Copy link
Contributor

This module is working with python3 on the beaglebone black running Arch Linux. Tested on DHT 11.

@M3taKn1ght
Copy link

I also tested it with a Pi an Python 3. There were no problems. You only have to include the lib and start with work

@Cabalist
Copy link

Cabalist commented Dec 9, 2015

@M3taKn1ght Could you explain what you mean by "include the lib and start with work"? I am getting the following error on python3 after running sudo python setup.py install

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c source/_Raspberry_Pi_Driver.c -o build/temp.linux-armv6l-2.7/source/_Raspberry_Pi_Driver.o -std=gnu99
source/_Raspberry_Pi_Driver.c:21:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1

@bennuttall
Copy link

Try installing python-dev:

sudo apt-get install python-dev

@Cabalist
Copy link

Cabalist commented Dec 9, 2015

That did it. I had python3-dev but apparently that is not base package I needed. Thanks!

@bychkov
Copy link

bychkov commented Feb 3, 2016

For those who need support for python3, you can find it in the following repo:
https://github.com/JoBergs/Adafruit_Python_DHT

@ladyada
Copy link
Member

ladyada commented Feb 3, 2016

@tdicola is spending this week and next doing a major overhaul of all our python libs to do: py3 support, pep8, and pypification. its...exciting and fun :) will close this issue once thats compete.

@bennuttall
Copy link

<3

@ladyada
Copy link
Member

ladyada commented Feb 3, 2016

yep both python <3 and <2 will be supported ;)

@bennuttall
Copy link

Haha

@Djiit
Copy link

Djiit commented May 22, 2016

Hi there,

I just tested the lib with Python3. Working like a charm!

Should we update the README and close this issue ?

@tdicola
Copy link
Contributor

tdicola commented May 23, 2016

Yep this one is all ready for Python 2 and 3 now. Grab the latest code and it should install with either 2.7 or 3.3/3.4+.

@tdicola tdicola closed this as completed May 23, 2016
@bennuttall
Copy link

Great. Is there a way you can also remove the necessity for using sudo?

@tomber42
Copy link

i want to install on python3 with sudo pip3 install adafruit_python_dht and got "ImportError: No module named 'platform_detect'"

Another try with sudo pip install adafruit_python_dht works, but module is only available in python2.7

I'm totaly new to python.. what i'm doing wrong?

@tdicola
Copy link
Contributor

tdicola commented Jun 30, 2017

You need to install from source like the guide mentions: https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging/software-install-updated The tricky thing about pip and python's package index is that it doesn't handle well a case where you have one platform (Linux) but different hardware-specific binaries. In particular the library needs to compile special code for the Beaglebone Black vs. Raspberry Pi to do fast GPIO access. Unfortunately folks have put the library on pip and it's really unknown what binary might be there--Beaglebone Black vs. Raspberry Pi vs. something else. Stick to the setup.py install and it will compile and install it correctly for your platform.

@jarvis-owl
Copy link

I got trapped with pip/pip3 and python/python3.
@tdicola helped me!

sudo python3 setup.py install

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests