Closed csylvain closed 5 years ago
this isnt too surprising - we havent tested it because on linux you tend to use the built in RTC support
pip3 install
or pip3 install --user
(no sudo
) installs in ~/.local/lib/python3.<something>/site-packages
. does your sys.path
contain that directory?
What OS and OS version are you using?
Might just be a case issue here:
https://github.com/adafruit/Adafruit_CircuitPython_DS3231/blob/master/setup.py#L59
yes, my sys.path has that directory. i already have bme280, and tsl2561 py modules installed (and tested). Raspbian 9 (kernel 4.14.79+) on a Pi 3B+ kernel has ds3232 rtc driver in /lib/modules/..rtc/ (and some other Dallas P/Ns but no ds3231)
I think it's just case on the name. PR incoming:
pi@raspberrypi:~/Adafruit_CircuitPython_DS3231 $ git diff
diff --git a/setup.py b/setup.py
index 57ffc16..d1096bc 100644
--- a/setup.py
+++ b/setup.py
@@ -56,5 +56,5 @@ setup(
# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
- py_modules=['adafruit_DS3231'],
+ py_modules=['adafruit_ds3231'],
)
pi@raspberrypi:~/Adafruit_CircuitPython_DS3231 $ virtualenv .env
Using base prefix '/usr'
New python executable in /home/pi/Adafruit_CircuitPython_DS3231/.env/bin/python3
Also creating executable in /home/pi/Adafruit_CircuitPython_DS3231/.env/bin/python
Installing setuptools, pip, wheel...
done.
pi@raspberrypi:~/Adafruit_CircuitPython_DS3231 $ find .env|grep ds32
pi@raspberrypi:~/Adafruit_CircuitPython_DS3231 $ source .env/bin/activate
(.env) pi@raspberrypi:~/Adafruit_CircuitPython_DS3231 $ pip3 install .
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Processing /home/pi/Adafruit_CircuitPython_DS3231
Collecting adafruit-circuitpython-register (from adafruit-circuitpython-ds3231==2.1.2.dev0+g088ada2.d20181129)
Using cached https://www.piwheels.org/simple/adafruit-circuitpython-register/adafruit_circuitpython_register-1.3.2-py3-none-any.whl
Collecting adafruit-circuitpython-busdevice (from adafruit-circuitpython-ds3231==2.1.2.dev0+g088ada2.d20181129)
Using cached https://www.piwheels.org/simple/adafruit-circuitpython-busdevice/adafruit_circuitpython_busdevice-2.2.7-py3-none-any.whl
Collecting Adafruit-Blinka (from adafruit-circuitpython-busdevice->adafruit-circuitpython-ds3231==2.1.2.dev0+g088ada2.d20181129)
Using cached https://www.piwheels.org/simple/adafruit-blinka/Adafruit_Blinka-0.3.2-py3-none-any.whl
Collecting rpi-ws281x>=4.0.0; platform_machine == "armv7l" (from Adafruit-Blinka->adafruit-circuitpython-busdevice->adafruit-circuitpython-ds3231==2.1.2.dev0+g088ada2.d20181129)
Using cached https://files.pythonhosted.org/packages/dc/46/934500cf2f68c63842839ae7584225c95a18749ca1b8d33da2a30f3930d4/rpi_ws281x-4.1.0-cp35-cp35m-linux_armv7l.whl
Collecting Adafruit-GPIO (from Adafruit-Blinka->adafruit-circuitpython-busdevice->adafruit-circuitpython-ds3231==2.1.2.dev0+g088ada2.d20181129)
Using cached https://www.piwheels.org/simple/adafruit-gpio/Adafruit_GPIO-1.0.3-py3-none-any.whl
Collecting spidev (from Adafruit-GPIO->Adafruit-Blinka->adafruit-circuitpython-busdevice->adafruit-circuitpython-ds3231==2.1.2.dev0+g088ada2.d20181129)
Using cached https://www.piwheels.org/simple/spidev/spidev-3.2-cp35-cp35m-linux_armv7l.whl
Collecting adafruit-pureio (from Adafruit-GPIO->Adafruit-Blinka->adafruit-circuitpython-busdevice->adafruit-circuitpython-ds3231==2.1.2.dev0+g088ada2.d20181129)
Using cached https://www.piwheels.org/simple/adafruit-pureio/Adafruit_PureIO-0.2.3-py3-none-any.whl
Building wheels for collected packages: adafruit-circuitpython-ds3231
Running setup.py bdist_wheel for adafruit-circuitpython-ds3231 ... \^[[done
Stored in directory: /tmp/pip-ephem-wheel-cache-rzoub5yn/wheels/82/99/fa/14880e277e26e9b6877eb2ad17aa8db4ff6c1223f8de9c83af
Successfully built adafruit-circuitpython-ds3231
Installing collected packages: adafruit-circuitpython-register, rpi-ws281x, spidev, adafruit-pureio, Adafruit-GPIO, Adafruit-Blinka, adafruit-circuitpython-busdevice, adafruit-circuitpython-ds3231
Successfully installed Adafruit-Blinka-0.3.2 Adafruit-GPIO-1.0.3 adafruit-circuitpython-busdevice-2.2.7 adafruit-circuitpython-ds3231-2.1.2.dev0+g088ada2.d20181129 adafruit-circuitpython-register-1.3.2 adafruit-pureio-0.2.3 rpi-ws281x-4.1.0 spidev-3.2
(.env) pi@raspberrypi:~/Adafruit_CircuitPython_DS3231 $ find .env | grep ds32
.env/lib/python3.5/site-packages/adafruit_circuitpython_ds3231-2.1.2.dev0+g088ada2.d20181129.dist-info
.env/lib/python3.5/site-packages/adafruit_circuitpython_ds3231-2.1.2.dev0+g088ada2.d20181129.dist-info/METADATA
.env/lib/python3.5/site-packages/adafruit_circuitpython_ds3231-2.1.2.dev0+g088ada2.d20181129.dist-info/top_level.txt
.env/lib/python3.5/site-packages/adafruit_circuitpython_ds3231-2.1.2.dev0+g088ada2.d20181129.dist-info/INSTALLER
.env/lib/python3.5/site-packages/adafruit_circuitpython_ds3231-2.1.2.dev0+g088ada2.d20181129.dist-info/RECORD
.env/lib/python3.5/site-packages/adafruit_circuitpython_ds3231-2.1.2.dev0+g088ada2.d20181129.dist-info/WHEEL
.env/lib/python3.5/site-packages/adafruit_circuitpython_ds3231-2.1.2.dev0+g088ada2.d20181129.dist-info/LICENSE
.env/lib/python3.5/site-packages/adafruit_ds3231.py
.env/lib/python3.5/site-packages/__pycache__/adafruit_ds3231.cpython-35.pyc
follow-up: shouldn't pip3 complain/warn a package was specified but no package file is created in the filesystem? (it's a standard configuration management post-install check)
did: pip3 install adafruit-circuitpython-ds3231 and: pip3 install --upgrade adafruit-circuitpython-ds3231
got: adafruit_circuitpython_ds3231-2.1.1.dist-info/ and its contents but: couldn't 'import adafruit_ds3231' because there was no adafruit_ds3231.py in site-packages/
strange. tried to figure it out. then gave up and just grabbed a copy from here and put it in site-packages. import (and the rest) works now.