Giter Site home page Giter Site logo

Comments (7)

Gadgetoid avatar Gadgetoid commented on June 11, 2024

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.

Gadgetoid avatar Gadgetoid commented on June 11, 2024

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.

C-D-Lewis avatar C-D-Lewis commented on June 11, 2024

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.

Gadgetoid avatar Gadgetoid commented on June 11, 2024

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.

C-D-Lewis avatar C-D-Lewis commented on June 11, 2024

Thanks @Gadgetoid, I will re-attempt this weekend!

from inky.

C-D-Lewis avatar C-D-Lewis commented on June 11, 2024

@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.

C-D-Lewis avatar C-D-Lewis commented on June 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.