Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.7 installation problems #78

Closed
daywalker90 opened this issue Jul 12, 2018 · 8 comments
Closed

Python 3.7 installation problems #78

daywalker90 opened this issue Jul 12, 2018 · 8 comments

Comments

@daywalker90
Copy link

hiho,
i currently need python 3.7 and plyvel.
Problem is there seem to be no binary packages for 3.7 and when running sudo python3.7 -m pip install plyvel i get the same error as in #62

Collecting plyvel
  Downloading https://files.pythonhosted.org/packages/e0/7b/9302e33972c4af861f5a425cb37468b4dbb17d7a4d282a657bfdb240055e/plyvel-1.0.4.tar.gz (338kB)
    100% |████████████████████████████████| 348kB 2.6MB/s
Building wheels for collected packages: plyvel
  Running setup.py bdist_wheel for plyvel ... error
  Complete output from command /usr/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-aco5y3_4/plyvel/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpxz_2v1qopip-wheel- --python-tag cp37:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/plyvel
  copying plyvel/__init__.py -> build/lib.linux-x86_64-3.7/plyvel
  copying plyvel/_version.py -> build/lib.linux-x86_64-3.7/plyvel
  running build_ext
  building 'plyvel._plyvel' extension
  creating build/temp.linux-x86_64-3.7
  creating build/temp.linux-x86_64-3.7/plyvel
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c plyvel/_plyvel.cpp -o build/temp.linux-x86_64-3.7/plyvel/_plyvel.o -Wall -g
  plyvel/_plyvel.cpp: In function ‘int __pyx_f_6plyvel_7_plyvel_parse_options(leveldb::Options*, bool, bool, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, int, PyObject*, PyObject*)’:
  plyvel/_plyvel.cpp:3341:22: error: ‘struct leveldb::Options’ has no member named ‘max_file_size’; did you mean ‘max_open_files’?
       __pyx_v_options->max_file_size = __pyx_t_4;
                        ^~~~~~~~~~~~~
                        max_open_files
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for plyvel
  Running setup.py clean for plyvel
Failed to build plyvel
Installing collected packages: plyvel
  Running setup.py install for plyvel ... error
    Complete output from command /usr/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-aco5y3_4/plyvel/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-fe92ccvi-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/plyvel
    copying plyvel/__init__.py -> build/lib.linux-x86_64-3.7/plyvel
    copying plyvel/_version.py -> build/lib.linux-x86_64-3.7/plyvel
    running build_ext
    building 'plyvel._plyvel' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/plyvel
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c plyvel/_plyvel.cpp -o build/temp.linux-x86_64-3.7/plyvel/_plyvel.o -Wall -g
    plyvel/_plyvel.cpp: In function ‘int __pyx_f_6plyvel_7_plyvel_parse_options(leveldb::Options*, bool, bool, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, int, PyObject*, PyObject*)’:
    plyvel/_plyvel.cpp:3341:22: error: ‘struct leveldb::Options’ has no member named ‘max_file_size’; did you mean ‘max_open_files’?
         __pyx_v_options->max_file_size = __pyx_t_4;
                          ^~~~~~~~~~~~~
                          max_open_files
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-aco5y3_4/plyvel/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-fe92ccvi-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-aco5y3_4/plyvel/

despite having
apt policy libleveldb-dev
Installed: 1.20-2

lsb_release -a

Distributor ID: Debian
Description:    Debian GNU/Linux testing (buster)
Release:        testing
Codename:       buster

Anyone able to help me?
Thanks in advance.

@wbolster
Copy link
Owner

are you sure you compile against leveldb 1.20+? it should have the max_file_size option: https://github.com/google/leveldb/releases/tag/v1.20

@daywalker90
Copy link
Author

im not exactly sure what you mean, but i only have these leveldb packages

sudo apt search leveldb |grep installed
libleveldb-dev/testing,now 1.20-2 amd64 [installed]
libleveldb1v5/testing,now 1.20-2 amd64 [installed,automatic]

@wbolster
Copy link
Owner

wbolster commented Jul 12, 2018

on an ubuntu (bionic) system with these packages installed:

ii  libleveldb-dev:amd64                                           1.20-2                               amd64                                fast key-value storage library (development files)
ii  libleveldb1v5:amd64                                            1.20-2                               amd64                                fast key-value storage library

... plyvel builds, installs, and runs correctly using python 3.7:

$ tox -e py37
GLOB sdist-make: /home/wbolster/Projects/wbolster/plyvel/setup.py
py37 inst-nodeps: /home/wbolster/Projects/wbolster/plyvel/.tox/dist/plyvel-1.0.4.zip
py37 installed: atomicwrites==1.1.5,attrs==18.1.0,coverage==4.5.1,more-itertools==4.2.0,pluggy==0.6.0,plyvel==1.0.4,py==1.5.4,pytest==3.6.3,pytest-cov==2.5.1,six==1.11.0
py37 runtests: PYTHONHASHSEED='2149402503'
py37 runtests: commands[0] | make test
cython --version
Cython version 0.27.3
cython --cplus --fast-fail --annotate plyvel/_plyvel.pyx
python setup.py build_ext --inplace --force
running build_ext
building 'plyvel._plyvel' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.7-1t2gIN/python3.7-3.7.0~b3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -I/home/wbolster/Projects/wbolster/plyvel/.tox/py37/include/python3.7m -c plyvel/_plyvel.cpp -o build/temp.linux-x86_64-3.7/plyvel/_plyvel.o -Wall -g
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.7-1t2gIN/python3.7-3.7.0~b3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -I/home/wbolster/Projects/wbolster/plyvel/.tox/py37/include/python3.7m -c plyvel/comparator.cpp -o build/temp.linux-x86_64-3.7/plyvel/comparator.o -Wall -g
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fdebug-prefix-map=/build/python3.7-1t2gIN/python3.7-3.7.0~b3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.7/plyvel/_plyvel.o build/temp.linux-x86_64-3.7/plyvel/comparator.o -lleveldb -o build/lib.linux-x86_64-3.7/plyvel/_plyvel.cpython-37m-x86_64-linux-gnu.so
copying build/lib.linux-x86_64-3.7/plyvel/_plyvel.cpython-37m-x86_64-linux-gnu.so -> plyvel
py.test
============================================================================================================================== test session starts ===============================================================================================================================
platform linux -- Python 3.7.0b3, pytest-3.6.3, py-1.5.4, pluggy-0.6.0 -- /home/wbolster/Projects/wbolster/plyvel/.tox/py37/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/wbolster/Projects/wbolster/plyvel, inifile: setup.cfg
plugins: cov-2.5.1
collected 49 items                                                                                                                                                                                                                                                               

test/test_plyvel.py::test_version PASSED
[...]
=========================================================================================================================== 49 passed in 4.00 seconds ============================================================================================================================
____________________________________________________________________________________________________________________________________ summary _____________________________________________________________________________________________________________________________________
  py37: commands succeeded
  congratulations :)

@daywalker90
Copy link
Author

hm thanks for checking. Am i correct in assuming that my pip finds SOME leveldb that is maybe not the one installed by apt?

@daywalker90
Copy link
Author

I just removed my libleveldb-dev packages and get the same error. I even checked my system for leveldb .so files, there were none left.

@daywalker90
Copy link
Author

ok i solved it. So i did have at some point leveldb ~1.18 but removed it some time in the past. But there were some files left in /usr/local/include/leveldb. After deleting them installing plyvel 1.0.4 with python3.7 worked. Thanks for the help. I think you can close this issue.

@wbolster
Copy link
Owner

cool, so this was a local issue on your machine. at some point i'll ship 3.7 wheels, but the last release was before python 3.7 existed.

@wbolster
Copy link
Owner

i published plyvel 1.0.5 with python 3.7 wheels on pypi. https://plyvel.readthedocs.io/en/latest/news.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants