wbolster / plyvel

Plyvel, a fast and feature-rich Python interface to LevelDB
https://plyvel.readthedocs.io/
Other
530 stars 75 forks source link

Installing on OSX 10.9 #22

Closed AlessandroEmm closed 10 years ago

AlessandroEmm commented 10 years ago

Hey there I tried to pip install plyvel on OSX (python 3.3) and there seems to be a problem with the compilation.

leveldb version 1.19.0

cc -Wno-unused-result -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/Versions/3.3/include/python3.3m -c plyvel/_plyvel.cpp -o build/temp.macosx-10.9-x86_64-3.3/plyvel/_plyvel.o -Wall -g plyvel/_plyvel.cpp:13845:125: warning: offset of on non-POD type 'struct pyx_obj_6plyvel_7_plyvel_Iterator' [-Winvalid-offsetof] if (pyx_type_6plyvel_7_plyvel_Iterator.tp_weaklistoffset == 0) pyx_type_6plyvel_7_plyvel_Iterator.tp_weaklistoffset = offsetof(struct __pyx_obj_6plyvel_7_plyvel_Iterator, weakref__); ^ ~~~ /Library/Developer/CommandLineTools/usr/bin/../lib/clang/5.0/include/stddef.h:84:24: note: expanded from macro 'offsetof'

define offsetof(t, d) __builtin_offsetof(t, d)

                       ^
1 warning generated.
cc -Wno-unused-result -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python3/3.3.2/Frameworks/Python.framework/Versions/3.3/include/python3.3m -c plyvel/comparator.cpp -o build/temp.macosx-10.9-x86_64-3.3/plyvel/comparator.o -Wall -g
c++ -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.9-x86_64-3.3/plyvel/_plyvel.o build/temp.macosx-10.9-x86_64-3.3/plyvel/comparator.o -lleveldb -o build/lib.macosx-10.9-x86_64-3.3/plyvel/_plyvel.so
warning: no files found matching 'plyvel/*.pxi'

Any clue what goes wrong?

Thank you!

wbolster commented 10 years ago

Are you sure something actually went wrong? Are you sure there's no .so file being generated?

The compiler warning does not look harmful in this case. GCC doesn't show it; Clang does though. I can't do anything about it either, since the C code is generated by Cython.

The "no files found matching 'plyvel/*.pxi'" warning has nothing to do with compilation; it's a setuptools warning I think.

AlessandroEmm commented 10 years ago

To be very honest, I ignored the error or warnings at first. But I constantly got

db = plyvel.DB('/tmp', create_if_missing=True)

File "_plyvel.pyx", line 231, in plyvel._plyvel.DB.init (plyvel/_plyvel.cpp:2740)

File "_plyvel.pyx", line 75, in plyvel._plyvel.raise_for_status (plyvel/_plyvel.cpp:1347)

plyvel._plyvel.IOError: b'IO error: lock /tmp/LOCK: Resource temporarily unavailable'

Due to that I thought it may be related to all that output. Any clue why this is arising?

AlessandroEmm commented 10 years ago

Sorry Gmail messed up my answer, here it is again:

To be very honest, I ignored the error or warnings at first. But I constantly got

db = plyvel.DB('/tmp', create_if_missing=True)

File "_plyvel.pyx", line 231, in plyvel._plyvel.DB.init (plyvel/_plyvel.cpp:2740)

File "_plyvel.pyx", line 75, in plyvel._plyvel.raise_for_status (plyvel/_plyvel.cpp:1347)

plyvel._plyvel.IOError: b'IO error: lock /tmp/LOCK: Resource temporarily unavailable'

Due to that I thought it may be related to all that output. Any clue why this is arising?

wbolster commented 10 years ago

If import plyvel worked, the compilation/installation went fine.

LevelDB acquires an (cooperative) file system lock file to prevent multiple processes to access the same database. Are you sure there is only a single process accessing the database?

AlessandroEmm commented 10 years ago

My bad then, sorry.

Yes definitely, I have never been using leveldb before and have been pointing to several places for the DB creation.

The files seem to get created (CURRENT, LOCK, LOG). But nothing seems to happen after that.

AlessandroEmm commented 10 years ago

https://groups.google.com/forum/#!topic/py-leveldb/XHo27ITdvvI

Looks like bottle is still forking the process and it doesnt cause of that. I have too look for a solution with the bottle guys.

Sorry for disturbing.

wbolster commented 10 years ago

You could try with Flask; almost the same code layout for small projects...

— Wouter

(Sent from my phone. Please ignore the typos.)

Alessandro notifications@github.com schreef:

https://groups.google.com/forum/#!topic/py-leveldb/XHo27ITdvvI

Looks like bottle is still forking the process and it doesnt cause of that. I have too look for a solution with the bottle guys.

Sorry for disturbing.


Reply to this email directly or view it on GitHub: https://github.com/wbolster/plyvel/issues/22#issuecomment-27175875

AlessandroEmm commented 10 years ago

Hey Wouter

the Problem with flask is its usage of dependencies and with that not being python 3 ready really

http://flask.pocoo.org/docs/advanced_foreword/#the-status-of-python-3

Which means I have to stick with redis for now...

Thank you anyway! Alessandro

wbolster commented 10 years ago

I think that part of the docs is obsolete. Flask, Jinja, and Werkzeug support Python 3.3+ very well, and did so for months.