2

I'm trying to import pyephem in python on my raspberry pi but I get the following error:

pi@ospi ~/downloads/pyephem-3.7.5.3 $ python
Python 2.7.3 (default, Mar 18 2014, 05:13:23)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ephem
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "ephem/__init__.py", line 5, in <module>
    import ephem._libastro as _libastro
ImportError: No module named _libastro

I installed the module using the following:

sudo apt-get install python-dev 
sudo apt-get install python-pip 
sudo pip install pyephem

Any ideas?

carlodurso
  • 2,886
  • 4
  • 24
  • 37
Adam
  • 31
  • 1
  • 4
  • `pyephem` is a python interface to `libastro`, that `pip` needs to build using a C compiler on your rasp. can you confirm that `pip` created and installed the above mentioned library? – gboffi Nov 06 '14 at 12:24
  • Hmm, any idea how I would confirm this? – Adam Nov 06 '14 at 20:05
  • A brute force scheme? `pip uninstall pyephem ; pip install pyephem` – gboffi Nov 06 '14 at 20:27

1 Answers1

1

I think my problem was I was out of space on my 8GB SD card. I initially tried to update my pi using:

sudo apt-get update
sudo apt-get upgrade 
sudo rpi-update

but doing this caused an out of disc space error. I got a 16GB sd card, loaded a saved backup of my system on it. After installing python-dev, python-pip, and pyephem, I could successfully import ephem.

Adam
  • 31
  • 1
  • 4
  • Great! I am glad that you were able to get it installed. Thanks for sharing this experience — I wish that the install tools would more clearly announce to the user that the install failed because there was no more space on the device. – Brandon Rhodes Nov 07 '14 at 01:23