No module named 'sgp4' but Requirement already satisfied: sgp4 in c:\

183 Views Asked by At

New to coding so appreciate this might be obvious - throwing an error at line 1:

from sgp4.earth_gravity import wgs84

which returns:

"No module named 'sgp4' "

however when I go to install using pip I'm told:

"Requirement already satisfied: sgp4 in c:\ ..."

Any ideas?

1

There are 1 best solutions below

1
On

sgp4 is a not a package, so installing via pip will not work. clone the project, git clone https://github.com/brandon-rhodes/python-sgp4.git

go the clone path

from sgp4.earth_gravity import wgs84
from sgp4.io import twoline2rv

if required add path.

import sys
sys.path.append('path/to/sgp4/library')
import sgp4