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

0.7.0/master fails to build with python 3.7, can't find std_memory.pxd #78

Open
smalyshev opened this issue May 1, 2020 · 5 comments
Open

Comments

@smalyshev
Copy link

I'm getting this when trying to install either master or 0.7.0:

running install
running bdist_egg
running egg_info
writing python_rocksdb.egg-info/PKG-INFO
writing dependency_links to python_rocksdb.egg-info/dependency_links.txt
writing requirements to python_rocksdb.egg-info/requires.txt
writing top-level names to python_rocksdb.egg-info/top_level.txt
cythoning rocksdb/_rocksdb.pyx to rocksdb/_rocksdb.cpp
/home/ec2-user/python-rocksdb/.eggs/Cython-3.0a3-py3.7-linux-x86_64.egg/Cython/Compiler/Main.py:344: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /home/ec2-user/python-rocksdb/rocksdb/_rocksdb.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)

Error compiling Cython file:
------------------------------------------------------------
...
from cpython.bytes cimport PyBytes_Size
from cpython.bytes cimport PyBytes_FromString
from cpython.bytes cimport PyBytes_FromStringAndSize
from cpython.unicode cimport PyUnicode_Decode

from std_memory cimport shared_ptr
^
------------------------------------------------------------

rocksdb/_rocksdb.pyx:15:0: 'std_memory.pxd' not found

This happens on both Linux and macos. 0.6.9 release from pypi installs fine. The file is there, so not sure why Python isn't happy.

@smalyshev smalyshev changed the title 0.7.0/master fails to build, can't find std_memory.pxd 0.7.0/master fails to build with python 3.7, can't find std_memory.pxd May 1, 2020
@smalyshev
Copy link
Author

If I replace all imports with relative ones, e.g.

from .std_memory cimport shared_ptr

it seems to work.

@davidecrs
Copy link

Hi,
I have the same problem but for much more libraries. The errors triggered on this command

python3 setup.py bdist_wheel

Ubuntu version: bionic
Python version: 3.6.9

This is a small example of the involved libraries

Error compiling Cython file:
------------------------------------------------------------
...
from cpython.bytes cimport PyBytes_Size
from cpython.bytes cimport PyBytes_FromString
from cpython.bytes cimport PyBytes_FromStringAndSize
from cpython.unicode cimport PyUnicode_Decode

from std_memory cimport shared_ptr
^
------------------------------------------------------------

rocksdb/_rocksdb.pyx:15:0: 'std_memory.pxd' not found

Error compiling Cython file:
------------------------------------------------------------
...
from cpython.bytes cimport PyBytes_Size
from cpython.bytes cimport PyBytes_FromString
from cpython.bytes cimport PyBytes_FromStringAndSize
from cpython.unicode cimport PyUnicode_Decode

from std_memory cimport shared_ptr
^
------------------------------------------------------------

rocksdb/_rocksdb.pyx:15:0: 'std_memory/shared_ptr.pxd' not found

Error compiling Cython file:
------------------------------------------------------------
...
from cpython.bytes cimport PyBytes_FromString
from cpython.bytes cimport PyBytes_FromStringAndSize
from cpython.unicode cimport PyUnicode_Decode

from std_memory cimport shared_ptr
cimport options
       ^
------------------------------------------------------------

rocksdb/_rocksdb.pyx:16:8: 'options.pxd' not found

Error compiling Cython file:
------------------------------------------------------------
...
from cpython.bytes cimport PyBytes_FromStringAndSize
from cpython.unicode cimport PyUnicode_Decode

from std_memory cimport shared_ptr
cimport options
cimport merge_operator
       ^
------------------------------------------------------------

rocksdb/_rocksdb.pyx:17:8: 'merge_operator.pxd' not found

@jansegre
Copy link

jansegre commented Jun 8, 2020

I've run into this issue too. Though it seems to build fine if I force Cython version to be <0.30, it probably has to do with Cython releasing versions 3.0a* (https://github.com/cython/cython/releases). I wish Cython version wasn't unbound on setup.py. Sadly I don't know how to force the Cython version when installing python-rocksdb from pip.

@cordawyn
Copy link

I was getting same errors, but upgrading pip (and friends) helped here.

pip install -U pip setuptools wheel

@fgimian
Copy link

fgimian commented Oct 16, 2020

I was getting same errors, but upgrading pip (and friends) helped here.

pip install -U pip setuptools wheel

This helped on Fedora 32 here too, thanks!

Thanks
Fotis

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

No branches or pull requests

5 participants