I copied a program from the Adafruit webpage to test my GPS module and before running it I installed the Python gps
with sudo apt-get install python-gps
but when I run the program I get this error:
pi@raspberrypi:~ $ python gps.py
Traceback (most recent call last):
File "gps.py", line 1, in <module>
import gps
File "/home/pi/gps.py", line 4, in <module>
session = gps.gps("localhost", "2947")
TypeError: 'module' object is not callable
I am new with Python so I don't know what is going wrong. I think the program can't find the library but I don't know why and how fix it.
Info:
- I am using a Raspberry Pi 3 running Jessie
- The GPS module is a Ublox NEO 6m
-
Could you include how you installed the Python module?Darth Vader– Darth Vader ♦2017年06月07日 18:26:45 +00:00Commented Jun 7, 2017 at 18:26
1 Answer 1
I feel so noob. The problem was that I had named the file as gps.py. So it can't import the gps library. Now is working.
-
Please accept your answer with a click on the tick on its left side. Only this will finish the question and it will not pop up again and again after years.Ingo– Ingo2019年12月04日 18:33:51 +00:00Commented Dec 4, 2019 at 18:33