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

cffi not working with pypy: ImportError: No module named zstd_cffi #60

Closed
rtkbkish opened this issue Oct 29, 2018 · 4 comments
Closed

Comments

@rtkbkish
Copy link

rtkbkish commented Oct 29, 2018

We run our infrastructure using pypy and are trying to incorporate zstd into our pipeline.

Import doesn't work. It looks like the cffi object is created incorrectly

$virtualenv -p pypy2-v6.0.0-linux64/bin/pypy
pypy        pypy.debug
$virtualenv -p pypy2-v6.0.0-linux64/bin/pypy pypy6-env
Running virtualenv with interpreter pypy2-v6.0.0-linux64/bin/pypy
New pypy executable in /home/bkish/pypy6-env/bin/pypy
Installing setuptools, pip, wheel...done.
$source pypy6-env/bin/activate
$pip install zstandard
Collecting zstandard
  Using cached https://files.pythonhosted.org/packages/29/21/4612a4b9e628d61aa045558ff008452378b5a333e5a64f7de29dee8b1e77/zstandard-0.10.1.tar.gz
Requirement already satisfied: cffi>=1.11 in ./pypy2-v6.0.0-linux64/lib_pypy (from zstandard) (1.11.5)
Building wheels for collected packages: zstandard
  Running setup.py bdist_wheel for zstandard ... done
  Stored in directory: /home/bkish/.cache/pip/wheels/e6/f1/ac/4498937124aecdc0b12b9ac6de1984619429b02b476427761e
Successfully built zstandard
Installing collected packages: zstandard
Successfully installed zstandard-0.10.1
$python
Python 2.7.13 (ab0b9caf307d, Apr 24 2018, 18:04:42)
[PyPy 6.0.0 with GCC 6.2.0 20160901] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>> import zstandard
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/bkish/pypy6-env/site-packages/zstandard/__init__.py", line 38, in <module>
    from zstd_cffi import *
ImportError: No module named zstd_cffi
>>>>
$pip uninstall zstandard
Uninstalling zstandard-0.10.1:
  Would remove:
    /home/bkish/pypy6-env/site-packages/_zstd_cffi.pypy-41.so
    /home/bkish/pypy6-env/site-packages/zstandard-0.10.1.dist-info/*
    /home/bkish/pypy6-env/site-packages/zstandard/*
    /home/bkish/pypy6-env/site-packages/zstd.pypy-41.so
Proceed (y/n)? y
  Successfully uninstalled zstandard-0.10.1
$
@aawise
Copy link

aawise commented Nov 1, 2018

Same issue with pypy3 / cffi 1.11.5. Tested zstandard versions from 0.9 to 0.10.1

@indygreg
Copy link
Owner

indygreg commented Nov 1, 2018

I thought this would have been fixed by 0b010fd. Perhaps we're missing something in setup.py with regards to this file...

@aawise
Copy link

aawise commented Nov 2, 2018

Just took a look. It seems that adding py_modules = ['zstd_cffi'] to the setup call fixed the problem for me.

indygreg added a commit that referenced this issue Nov 3, 2018
@indygreg
Copy link
Owner

indygreg commented Nov 3, 2018

This will be fixed in 0.10.2.

@indygreg indygreg closed this as completed Nov 3, 2018
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

3 participants