2

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
1
  • Could you include how you installed the Python module?
    – Darth Vader
    Jun 7, 2017 at 18:26

1 Answer 1

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.

1
  • 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
    Dec 4, 2019 at 18:33

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.