GithubHelp home page GithubHelp logo

Comments (8)

berkaysit avatar berkaysit commented on August 28, 2024

I realized something; if I run the command with sudo like sudo python3 tsl2591_simpletest.py I encounter the error I mentioned above. But it can run without sudo. So, why?

from adafruit_circuitpython_tsl2591.

ladyada avatar ladyada commented on August 28, 2024

maybe you have different python libraries installed for root or user 'pi'?

from adafruit_circuitpython_tsl2591.

berkaysit avatar berkaysit commented on August 28, 2024

I installed the libraries Adafruit_Blinka, Adafruit_CircuitPython_BusDevice, Adafruit_CircuitPython_TSL2591 and I made installation like below for each library:

git clone https://github.com/adafruit/Adafruit_CircuitPython_TSL2591.git
cd Adafruit_CircuitPython_TSL2591
sudo python3 setup.py install

I did not choose any virtual environment. But could you please suggest how to check it? Or do you suggest any other installation method please?

from adafruit_circuitpython_tsl2591.

ladyada avatar ladyada commented on August 28, 2024

oh dont do that, use pip3
https://learn.adafruit.com/tsl2561/python-circuitpython
follow these instructions, you'll want to uninstall it from the way you did it above

from adafruit_circuitpython_tsl2591.

berkaysit avatar berkaysit commented on August 28, 2024

Thank you for your answer. I uninstall my previous installed libraries, and then installed the following;

sudo pip3 install adafruit-blinka
sudo pip3 install Adafruit_CircuitPython_TSL2591

But I still can run python3 example/tsl2591_simpletest.pywithout sudo, but with sudo I encountered the same following error:

sudo python3 tsl2591_simpletest.py 

Traceback (most recent call last):
  File "tsl2591_simpletest.py", line 14, in <module>
    sensor = adafruit_tsl2591.TSL2591(i2c)
  File "/usr/local/lib/python3.5/dist-packages/adafruit_tsl2591.py", line 111, in __init__
    self._device = i2c_device.I2CDevice(i2c, address)
  File "/usr/local/lib/python3.5/dist-packages/adafruit_bus_device/i2c_device.py", line 64, in __init__
    i2c.writeto(device_address, b'')
  File "/usr/local/lib/python3.5/dist-packages/busio.py", line 63, in writeto
    return self._i2c.writeto(address, buffer, stop=stop)
  File "/usr/local/lib/python3.5/dist-packages/adafruit_blinka/microcontroller/raspi_23/i2c.py", line 38, in writeto
    self._i2c_bus.write_bytes(address, buffer[start:end])
AttributeError: 'SMBus' object has no attribute 'write_bytes'

from adafruit_circuitpython_tsl2591.

ladyada avatar ladyada commented on August 28, 2024

maybe try 'sudo pip3 install --upgrade adafruit-blinka'
and also 'sudo pip3 install --upgrade Adafruit-GPIO' and 'sudo pip3 install --upgrade Adafruit-PureIO`

from adafruit_circuitpython_tsl2591.

kattni avatar kattni commented on August 28, 2024

@berkaysit Hello! Are you still experiencing this issue? Let us know so we can help you out or close this issue. Thanks!

from adafruit_circuitpython_tsl2591.

ladyada avatar ladyada commented on August 28, 2024

closing due to lack of activity

from adafruit_circuitpython_tsl2591.

Related Issues (7)

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.