Code Monkey home page Code Monkey logo

Comments (12)

m-rtijn avatar m-rtijn commented on July 17, 2024

Hi @Georg2K2, thank you for using my library!

I have only been able to reproduce this issue by incorrectly importing the module.

>>> import mpu6050
>>> sensor = mpu6050(0x68)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable

You can either import the module using from mpu6050 import mpu6050 and call the class constructor with mpu6050(0x68) or import the module using import mpu6050 and call the constructor with mpu6050.mpu6050(0x68).

I hope this fixes your issue.

from mpu6050.

GRhOGS avatar GRhOGS commented on July 17, 2024

Like stated above, I import the module like:
from mpu6050 import mpu6050
and use it like described by you, but it still doesnt work for me :c

from mpu6050.

m-rtijn avatar m-rtijn commented on July 17, 2024

Hm. That is really weird. Does the example script (in the repository bin/mpu6050-example) work for you?

from mpu6050.

GRhOGS avatar GRhOGS commented on July 17, 2024

I get the error: No module named 'mpu6050'
I tried running the setup.py again, sadly it doesn't work. (also you might edit the instructions from "python setup.py install" to "sudo python setup.py install")
I tried doing the pip install, restarted and now I get "TypeError: 'module' object is not callable" on the example script

from mpu6050.

m-rtijn avatar m-rtijn commented on July 17, 2024

Which version of python are you using? If your system has both python 2.7.x and python 3, are you consistently using the same python version while testing?

from mpu6050.

GRhOGS avatar GRhOGS commented on July 17, 2024

im using python python 3

from mpu6050.

GRhOGS avatar GRhOGS commented on July 17, 2024

but I got it working now on Python 2.7.13!

from mpu6050.

m-rtijn avatar m-rtijn commented on July 17, 2024

Nice that it works now, could you maybe explain what you did differently with python 2.7? In the case that someone else might ever stumble on the same issue as you.

from mpu6050.

GRhOGS avatar GRhOGS commented on July 17, 2024

I just launched the script with python 2 instead of 3... ¯_(ツ)_/¯

from mpu6050.

tmubashshira avatar tmubashshira commented on July 17, 2024

I just launched the script with python 2 instead of 3... ¯_(ツ)_/¯

can you please tell the command you used to launch python 2 in raspberry pi??? I'm having the same error.....

from mpu6050.

tmubashshira avatar tmubashshira commented on July 17, 2024

I just launched the script with python 2 instead of 3... ¯_(ツ)_/¯

if you're using python 2, doesn't it create problem in other operations???

from mpu6050.

GRhOGS avatar GRhOGS commented on July 17, 2024

I didn't run into any other problems... I haven't used that pi in years, I would have to google it again as well, sorry :/ maybe something like 'python2.7' in cmd, I'm not a huge Ubuntu buff...

from mpu6050.

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.