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
asked Jun 7, 2017 at 15:30
1
  • Could you include how you installed the Python module? Commented 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.

answered Jun 7, 2017 at 15:38
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. Commented Dec 4, 2019 at 18:33

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.