Advertisement
Guest User

Untitled

a guest
Aug 7th, 2023
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. For the life of me I can't seem to get this work
  2. Code:
  3. pip show skyfield
  4. Name: skyfield
  5. Version: 1.46
  6. Summary: Elegant astronomy for Python
  7. Home-page: http://github.com/brandon-rhodes/python-skyfield/
  8. Author: Brandon Rhodes
  9. Author-email: edited.org
  10. License: MIT
  11. Location: /home/ethan/python/lib/python3.11/site-packages
  12. Requires: certifi, jplephem, numpy, sgp4
  13. Required-by:
  14. I also have all the Requires installed
  15.  
  16. this is the error i get when i run the code
  17. Code:
  18. Traceback (most recent call last):
  19. File "/home/ethan/Pictures/edited.py", line 1, in <module>
  20. from skyfield.api import load
  21. ModuleNotFoundError: No module named 'skyfield'
  22.  
  23.  
  24. This is the actual code
  25. Code:
  26. from skyfield.api import load
  27.  
  28. skyfield_path = '/home/ethan/python/lib/python3.11/site-packages'
  29. # Create a timescale and ask the current time.
  30. ts = load.timescale()
  31. t = ts.now()
  32.  
  33. # Load the JPL ephemeris DE421 (covers 1900-2050).
  34. planets = load('de421.bsp')
  35. earth, mars = planets['earth'], planets['mars']
  36.  
  37. # What's the position of Mars, viewed from Earth?
  38. astrometric = earth.at(t).observe(mars)
  39. ra, dec, distance = astrometric.radec()
  40.  
  41. print(ra)
  42. print(dec)
  43. print(distance)
  44.  
  45.  
  46. I cant get any code to run with any library that's inside the virtual env , so I must be doing something wrong
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement