catern / rsyscall

Process-independent interface to Linux system calls
67 stars 8 forks source link

ModuleNotFoundError: No module named 'rsyscall._raw' #10

Closed carlosplanchon closed 2 years ago

carlosplanchon commented 2 years ago

I'm using Python 3.10.5 with pyenv, on Arch Linux x86_64, kernel 5.18.9-hardened1-1-hardened

In [1]: import rsyscall
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Input In [1], in <cell line: 1>()
----> 1 import rsyscall

File ~/.pyenv/versions/3.10.5/lib/python3.10/site-packages/rsyscall/__init__.py:116, in <module>
      1 """Process-independent interface to Linux system calls
      2 
      3 rsyscall provides an interface to an ever-growing subset of Linux system calls. This interface is:
   (...)
    114 
    115 """
--> 116 from rsyscall.thread import Thread, ChildThread
    117 from rsyscall.command import Command
    118 from rsyscall.path import Path

File ~/.pyenv/versions/3.10.5/lib/python3.10/site-packages/rsyscall/thread.py:5, in <module>
      3 from dataclasses import dataclass
      4 from rsyscall.command import Command
----> 5 from rsyscall.environ import Environment
      6 from rsyscall.epoller import Epoller, AsyncFileDescriptor
      7 from rsyscall.handle import FileDescriptor, WrittenPointer, Pointer, Task

File ~/.pyenv/versions/3.10.5/lib/python3.10/site-packages/rsyscall/environ.py:14, in <module>
     12 from dneio import run_all
     13 from rsyscall.command import Command
---> 14 from rsyscall.handle import Task, FileDescriptor, WrittenPointer
     15 from rsyscall.memory.ram import RAM
     16 from rsyscall.path import Path

File ~/.pyenv/versions/3.10.5/lib/python3.10/site-packages/rsyscall/handle/__init__.py:20, in <module>
      1 """Classes which own resources and provide the main syscall interfaces
      2 
      3 We have several resource-owning classes in this module: FileDescriptor, Pointer, Process,
   (...)
     17 
     18 """
     19 from __future__ import annotations
---> 20 from rsyscall._raw import ffi, lib # type: ignore
     21 from dataclasses import dataclass
     22 import rsyscall.far

ModuleNotFoundError: No module named 'rsyscall._raw'
catern commented 2 years ago

I'd expect that to happen if you didn't build/install the package correctly? Did the C extension build? How'd you install the package? From PyPI or from source? PyPI may well not work

carlosplanchon commented 2 years ago

I tried from PyPI. Building it from source worked, thx!