`python setup.py install` doesn't install `snappy._snappy_cffi` module

Aperta
#83 6 commenti 6 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
build-system

Direzione di ricerca

Riproduci il malfunzionamento con i passaggi elencati di virtualenv per Python 3.6, quindi confronta python setup.py install con il percorso funzionante bdist_egg. Ispeziona setup.py e i file segnalati snappy._snappy_cffi, _snappy e dell’estensione compilata; il lavoro è completato quando un’installazione diretta consente import snappy senza copiare manualmente i file.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Related: #78, #69

Repro

macOS 10.14.5, in a virtualenv with Python 3.6.9, python-snappy v0.5.4 (commit 602e9c10d743f71bef0bac5e4c4dffa17340d7b3)

  1. git clone https://github.com/andrix/python-snappy
  2. cd python-snappy
  3. git checkout master
  4. python setup.py build
  5. python setup.py install

Testing in IPython fails with the following error:

In [1]: import snappy
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
~/Documents/python-snappy/snappy/snappy.py in <module>()
     47 try:
---> 48     from ._snappy import UncompressError, compress, decompress, \
     49                          isValidCompressed, uncompress, _crc32c

ModuleNotFoundError: No module named 'snappy._snappy'

During handling of the above exception, another exception occurred:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-710a7f18823c> in <module>()
----> 1 import snappy

~/Documents/python-snappy/snappy/__init__.py in <module>()
      1 from __future__ import absolute_import
      2
----> 3 from .snappy import (
      4         compress,
      5         decompress,

~/Documents/python-snappy/snappy/snappy.py in <module>()
     49                          isValidCompressed, uncompress, _crc32c
     50 except ImportError:
---> 51     from .snappy_cffi import UncompressError, compress, decompress, \
     52                              isValidCompressed, uncompress, _crc32c
     53

~/Documents/python-snappy/snappy/snappy_cffi.py in <module>()
      1 from __future__ import absolute_import
      2
----> 3 from ._snappy_cffi import ffi, lib
      4
      5 try:

ModuleNotFoundError: No module named 'snappy._snappy_cffi'

Workaround

  1. python setup.py bdist_egg
  2. cd dist
  3. unzip python_snappy-0.5.4-py3.6-macosx-10.14-x86_64.egg
  4. cd snappy
  5. cp _snappy_cffi.abi3.so "${VIRTUAL_ENV}/lib/python3.6/site-packages/snappy/"

After performing the above steps, it is now possible to import snappy in a python shell without error.

(might also need to copy _snappy.py and _snappy.cpython-36m-darwin.so; not sure)

It appears that python setup.py install does not install these files.

Lingua principale
Python
Stelle
490
Fork
104
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di intake/python-snappy

Tutte le issue di intake/python-snappy

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.