1

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 Jun 7 '17 at 18:26
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.