Reputation: 655
I use the package named python-snappy. This package requires snappy library. So, I download and install snappy successfully by the following commands such as:
./configure
make
sudo make install
When I import snappy, I receive the errors:
from _snappy import CompressError, CompressedLengthError, \
ImportError: libsnappy.so.1 cannot open shared object file: No such file or directory
I'm using Python 2.7, snappy, python-snappy and Ubuntu 12.04 How can I fix this problem? Thanks
Upvotes: 3
Views: 10963
Reputation: 5055
the following worked for me:
$ conda install python-snappy
then in my code I used:
import snappy
Upvotes: 1
Reputation: 1
Here for e.g. anaconda python
google-snappy folder
$ ./configure
$ make
$ sudo make install
Then in python folder:
$ python setup.py build # here I get the same import _snappy error
$ python setup.py install # after this import works
Upvotes: 0
Reputation: 17500
Traditionally you might have to run the ldconfig
utility to update your /etc/ld.so.cache (or equivalent as appropriate to your OS). Sometimes it might be necessary to add new entries (paths) to your /etc/ld.so.conf.
Basically the shared object (so) loaders on many versions of Unix (and probably other Unix-like operating systems) use a cache to help resolve their base filenames into actual files to be loaded (usually mmap()'d). This is roughly similar to the intermittent need to run hash -r or rehash in your shell after adding things to directories in your PATH.
Usually you can just run ldconfig
with no arguments (possibly after adding your new library's path to your /etc/ld.so.conf text file). Good Makefiles will do this for you during make install
.
Here's a little bit more info: http://linux.101hacks.com/unix/ldconfig/
Upvotes: 3
Reputation: 17629
You can install the python-snappy and libsnappy1 from the ubuntu repos:
$ sudo apt-get install libsnappy1 python-snappy
You should not have to download anything.
Upvotes: 2