cha-messy / py-leveldb

Automatically exported from code.google.com/p/py-leveldb
Other
0 stars 0 forks source link

build fails due to __init__.py not found #20

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. follow installation instructions and run commands up to and including 
"python setup.py build", which produces two error messages
2. continuing with the instructions results in an error message when trying to 
import the module in python (v2.6):
>>> import leveldb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: libleveldb.so.1: cannot open shared object file: No such file or 
directory

What is the expected output? What do you see instead?
terminal output:
running build
running build_py
package init file '__init__.py' not found (or not a regular file)
package init file '__init__.py' not found (or not a regular file)
running build_ext

What version of the product are you using? On what operating system?
revision 54, Debian Linux 6.0

Please provide any additional information below.
creating an empty file called __init__.py in the main directory fixed the 
problem.

Original issue reported on code.google.com by danbr...@gmail.com on 28 Jun 2012 at 6:09

GoogleCodeExporter commented 8 years ago
update: even though the build completes, the module doesn't work properly in 
python.

>>> import leveldb
>>> db = leveldb.LevelDB()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'LevelDB'

Original comment by archive_...@strava.com on 28 Jun 2012 at 9:20

GoogleCodeExporter commented 8 years ago
There was something similar reported a while ago. 
http://code.google.com/p/py-leveldb/issues/detail?id=17

I think the __init__.py isn´t necessary. It should work regardless. I´ll 
investigate this tomorrow.

Original comment by arnim...@gmail.com on 28 Jun 2012 at 11:34

GoogleCodeExporter commented 8 years ago
For some reason ( at least on ubuntu 12 ) the flags are not causing the build 
to link against the static leveldb.a. I modified the compile script to ( only 
compile the static lib ) make it work.

make libleveldb.a LDFLAGS='-L../snappy-read-only/.libs/ -Bstatic -lsnappy' 
OPT='-fPIC -O2 -DNDEBUG -DSNAPPY -I../snappy-read-only' SNAPPY_CFLAGS=''

Original comment by jayri...@gmail.com on 5 Jul 2012 at 10:11