Search code examples
pythonattributeerrorvs-web-site-projectpyephemsatellite

why do I get the error "AttributeError: SatTrack instance has no attribute 'show_location"?


I'm very new to python and this is also my first post here, so please don't be angry if I make some mistakes. I'm trying my best to explain my problem :)

I wanted to track the ISS with 2 servos, so I downloaded the SatTrack library (more information about it here: https://devpost.com/software/sattrack) with Python 2.7.9. I installed all the other required librarys and installed the setup.py file. When I was done I typed in the command > python -m sattrack.interactive into the cmd as the instruction said and the visualsation of the current position of the ISS worked completly fine. Then I tiped in the code:

from sattrack import SatTrack                # Import the `SatTrack` class:  
s = SatTrack()                               # Instantiate class  
s.set_location(lat='0', lon='0', ele=100)    # Set observer location
s.get_tle('ISS')                             # Search CELESTRAK or AMSAT for satellite TLE data
s.begin_computing()                          # Start calculating topocentric coordinates 
s.show_location()                            # Start printing satellite data to console
s.visualize()                                # Start a server and visualize satellite on map in browser

into the IDLE and pressed on "Run Module", but I just received the error message from above. This programme does the same thing as the small command above (At least I think so), but it's needed for the servo control code. So, how do I fix this? :)


Solution

  • The page you found on "devpost.com" seems to be out of date. Generally, the GitHub repository will be the most up-to-date source of documentation on a project. The devpost.com page links to the repository, which is here:

    https://devpost.com/software/sattrack

    The current README shows no show_location() call, presumably because it has been removed and is no longer supported? It was removed in the most recent update to the repository, in March 2017:

    https://github.com/hazrmard/SatTrack/commit/6eef1c921c7a64b4a777b9148aa076640627facf

    Alas, there is no explanation of why the change is made, or why that method is no longer supported.