intake / intake/python-snappy

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

Đang mở
#83 6 bình luận 6 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
490
Fork
104
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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 ()
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)
in ()
----> 1 import snappy

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

~/Documents/python-snappy/snappy/snappy.py in ()
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 ()
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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Reproduce the failure with the listed Python 3.6 virtualenv steps, then compare `python setup.py install` with the working `bdist_egg` path. Inspect `setup.py` and the reported `snappy._snappy_cffi`, `_snappy`, and compiled extension files; done means a direct install allows `import snappy` without manually copying files.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
build-system
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.