Comments (7)
I'm not sure what's happened here. The issue appears to be with the smbus2
package, but glancing over the source/GitHub history suggests it hasn't changed meaningfully in a while.
It might be worth trying: sudo pip install smbus2=0.2.3
followed by sudo pip install inky
to see if it works around the problem.
from inky.
I grabbed the latest smbus2 package to inspect, and extras_require
looks fine. I suspect your downloaded/extracted file was corrupted, or some other temporary issue occured. You could also try:
sudo pip --no-cache-dir install smbus2
from inky.
Thanks @Gadgetoid for the swift feedback. I tried the first command to little success:
pi@raspberrypi:~ $ sudo pip install smbus2=0.2.3
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 269, in run
InstallRequirement.from_line(name, None))
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 173, in from_line
return cls(req, comes_from, url=url, prereleases=prereleases)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 71, in __init__
req = pkg_resources.Requirement.parse(req)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2793, in parse
reqs = list(parse_requirements(s))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2721, in parse_requirements
"version spec")
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2686, in scan_list
raise ValueError(msg, line, "at", line[p:])
ValueError: ('Expected version spec in', 'smbus2=0.2.3', 'at', '=0.2.3')
Also
pi@raspberrypi:~ $ sudo pip --no-cache-dir install smbus2
Usage:
pip <command> [options]
no such option: --no-cache-dir
Perhaps I need a new Python version or a cleaner environment?
from inky.
Oof I missed an =
in my command, despite trying not to miss an =
in my command. Try:
sudo pip install smbus2==0.2.3
The lack of a --no-cache-dir
option might suggest a very out of date smbus, worth trying a sudo apt update
followed by sudo apt upgrade
and then sudo pip install --upgrade pip
.
Is this an old Pi setup on Raspbian Jessie?
from inky.
Thanks @Gadgetoid, I will re-attempt this weekend!
from inky.
@Gadgetoid Still little success, sadly. Here is the versions I'm using:
Hardware: Pi Zero W
Software: Raspbian GNU/Linux 8 (jessie)
Python: 2.7.9 (/usr/bin/python
)
pip: pip 19.2.3 (/usr/local/bin/pip
)
And yet the same problem with installing smbus persists. Is it worth trying a completely fresh image?
from inky.
After a fresh Buster install and over an hour and a half of compiling numpy
, it finished installing successfully! However, I now have another issue (sadly!)
Python 2.7.16 (default, Apr 6 2019, 01:42:57)
[GCC 8.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import inky
>>> from inky import InkyPHAT
>>> inkyphat = InkyPHAT('yellow')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/inky/phat.py", line 27, in __init__
v_flip=False)
File "/usr/local/lib/python2.7/dist-packages/inky/inky.py", line 74, in __init__
self.eeprom = eeprom.read_eeprom()
File "/usr/local/lib/python2.7/dist-packages/inky/eeprom.py", line 103, in read_eeprom
i2c = SMBus(1)
File "/usr/local/lib/python2.7/dist-packages/smbus2/smbus2.py", line 279, in __init__
self.open(bus)
File "/usr/local/lib/python2.7/dist-packages/smbus2/smbus2.py", line 308, in open
self.fd = os.open(filepath, os.O_RDWR)
OSError: [Errno 2] No such file or directory: '/dev/i2c-1'
I did some Googling and determined that i2c was not enabled. I followed these instructions (with the exception of using apt
instead of pacman
to install the I2C tools, and after a reboot I could use InkyPHAT('yellow')
without the same error.
However, when trying to follow the 'set border' example in the README.md
file, (which should read inkyphat.BLACK
etc instead of ink.BLACK
, I got this:
>>> inkyphat.set_border(inkyphat.BLACK)
>>> inkyphat.show()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/inky/inky.py", line 325, in show
self._update(buf_a, buf_b, busy_wait=busy_wait)
File "/usr/local/lib/python2.7/dist-packages/inky/inky.py", line 238, in _update
self.setup()
File "/usr/local/lib/python2.7/dist-packages/inky/inky.py", line 213, in setup
self._spi.open(0, self.cs_pin)
IOError: [Errno 2] No such file or directory
After more Googling and using raspi-config
to enable the SPI interface, I am now able to use the display! 😄
Closing this now.
from inky.
Related Issues (20)
- Make inky work with NVIDIA Jetson Nano HOT 1
- Magic number and checksum for eeprom HOT 1
- Pi Zero W - Not Enough Ram to pip install seaborn HOT 1
- `InkyMockImpression.set_image` fails with `AttributeError`
- `InkyMockImpression` class doesn't easily support multiple resolutions
- Use on any non-Pi machines? HOT 3
- Treating Inky pHAT-Red as Black/White doesn't work
- Busy Wait error - Line 323/333 HOT 1
- AttributeError: 'FreeTypeFont' object has no attribute 'getsize'
- Odd permissions issue on new Inky Impressions 7.3" HOT 1
- error: externally-managed-environment HOT 1
- Forcing black and white only on 7 color. HOT 2
- Partial Update or Single Pixel Update for all Inky Impression HOT 1
- Incompatible with Raspberry Pi 5B? HOT 8
- Not installable on MacOS for development
- Can't get Inky to work on Raspberry Pi Zero 2 W HOT 3
- It didn't blow up HOT 6
- image.py stretches certain pictures with different aspect ratios to the screen HOT 2
- Trouble using numpy from the installation on headless raspberry pi HOT 4
- buttons.py doesn't work: RuntimeError: Failed to add edge detection
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inky.