Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

IOError on Python 2.7 / No such directory __pycache__/

Đang mở
#49 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

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

Hướng nghiên cứu

Bắt đầu trong snappy_cffi.py, quanh lệnh gọi verify của cffi, sau đó so sánh nó với API cffi được tham chiếu trong issue và traceback của verifier.py. Tái hiện trường hợp cài đặt Python 2.7 không dùng quyền root; hoàn thành khi việc import snappy không còn thất bại nếu pycache chưa tồn tại.

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

Mô tả

I try to use snappy which use cffi with a non-root user that can't create the pycache/ dir.
I got :

STDERR: Traceback (most recent call last):
      File "/opt/graphite/pypy/bin/django-admin", line 11, in <module>
        sys.exit(execute_from_command_line())
      File "/opt/graphite/pypy/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
        utility.execute()
      File "/opt/graphite/pypy/site-packages/django/core/management/__init__.py", line 302, in execute
        settings.INSTALLED_APPS
      File "/opt/graphite/pypy/site-packages/django/conf/__init__.py", line 55, in __getattr__
        self._setup(name)
      File "/opt/graphite/pypy/site-packages/django/conf/__init__.py", line 43, in _setup
        self._wrapped = Settings(settings_module)
      File "/opt/graphite/pypy/site-packages/django/conf/__init__.py", line 99, in __init__
        mod = importlib.import_module(self.SETTINGS_MODULE)
      File "/opt/pypy/pypy-5.7.1-linux_x86_64-portable/lib-python/2.7/importlib/__init__.py", line 37, in import_module
        __import__(name)
      File "/opt/graphite/webapp/graphite/settings.py", line 160, in <module>
        from graphite.local_settings import *  # noqa
      File "/opt/graphite/webapp/graphite/local_settings.py", line 53, in <module>
        from graphite.local_settings_dynamic import *
      File "/opt/graphite/webapp/graphite/local_settings_dynamic.py", line 1, in <module>
        from biggraphite.plugins import graphite
      File "/opt/graphite/pypy/site-packages/biggraphite/plugins/graphite.py", line 30, in <module>
        from biggraphite import graphite_utils
      File "/opt/graphite/pypy/site-packages/biggraphite/graphite_utils.py", line 17, in <module>
        from biggraphite import utils as bg_utils
      File "/opt/graphite/pypy/site-packages/biggraphite/utils.py", line 22, in <module>
        from biggraphite.drivers import cassandra as bg_cassandra
      File "/opt/graphite/pypy/site-packages/biggraphite/drivers/cassandra.py", line 34, in <module>
        from cassandra import cluster as c_cluster
      File "/opt/graphite/pypy/site-packages/cassandra/cluster.py", line 46, in <module>
        from cassandra.connection import (ConnectionException, ConnectionShutdown,
      File "/opt/graphite/pypy/site-packages/cassandra/connection.py", line 80, in <module>
        import snappy
      File "/opt/graphite/pypy/site-packages/snappy.py", line 50, in <module>
        from snappy_cffi import UncompressError, compress, decompress, \
      File "/opt/graphite/pypy/site-packages/snappy_cffi.py", line 169, in <module>
        ''', libraries=["snappy"])
      File "/opt/pypy/pypy-5.7.1-linux_x86_64-portable/lib_pypy/cffi/api.py", line 438, in verify
        lib = self.verifier.load_library()
      File "/opt/pypy/pypy-5.7.1-linux_x86_64-portable/lib_pypy/cffi/verifier.py", line 113, in load_library
        self._write_source()
      File "/opt/pypy/pypy-5.7.1-linux_x86_64-portable/lib_pypy/cffi/verifier.py", line 202, in _write_source
        with open(self.sourcefilename, "w") as fp:
    IOError: [Errno 2] No such file or directory: '/opt/graphite/pypy/site-packages/__pycache__/_cffi__g762f05ffx6bf5342b.c'

As far as I understand, it calls a deprecated method of cffi (http://cffi.readthedocs.io/en/latest/whatsnew.html?#v1-0-0).
A workaround would be to create pycache/ directory at the installation as root.

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

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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của intake/python-snappy

Tất cả issue của intake/python-snappy

Issue tương tự

Thêm issue về Python

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.