-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'module' object is not callable #22
Comments
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 I hope this fixes your issue. |
Like stated above, I import the module like: |
Hm. That is really weird. Does the example script (in the repository |
I get the error: No module named 'mpu6050' |
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? |
im using python python 3 |
but I got it working now on Python 2.7.13! |
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. |
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..... |
if you're using python 2, doesn't it create problem in other operations??? |
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... |
when I try to run the example code:
from mpu6050 import mpu6050
sensor = mpu6050(0x68)
print(sensor.get_accel_data())
It prints out an error on line 2 stating: 'module' object is not callable
I've installed it correctly, and there's no error when importing the module
The text was updated successfully, but these errors were encountered: