5,348 questions
Advice
0 votes
4 replies
141 views
How do I convert .py file to a .pyd properly?
I have a simple .py file in a directory called core_app\functions\my_function.py like this: from typing import Optional from core_app.routes.models import (Model1, Model2, Model3) from core_app.routes....
4 votes
1 answer
57 views
Cython memoryview pointer to empty array
The Cython docs discuss passing a pointer to a memoryview by using, e.g.: cdef double[::1] x_view = x # some array cdef double* ptr = &x_view[0] however, when that array x has no elements (x....
0 votes
1 answer
47 views
Cython memoryviews of Python object members with fused types
I am writing cython code with cython v3.1.5. I have defined these fused types: ctypedef fused index_t: int32_t int64_t ctypedef fused value_t: double double complex and am trying to ...
0 votes
1 answer
44 views
Empty object instantiation in Cython
I am working on a Cython interface to a C library. I have this class: cdef class CholeskyFactor: cdef cholmod_factor *_factor # ... etc. def __cinit__(self, A, *, order=None, **kwargs): ...
20 votes
2 answers
2k views
How to set up a simple hello-world example where a C function calls a Cython function calling a Python function?
I am having trouble making a simple "Hello World" python function which I can call from a C program. Here is the contents of my helloworld.py file: def hw(): print("Hello World") ...
0 votes
0 answers
42 views
Cython no module named error of own module
I am trying to compile a standalone executable from a Python project. It consists of several Python files written by me, with one Module being the "main" with the main function as the entry ...
3 votes
2 answers
136 views
Cython Multiple Definitions of Function
I am using Cython to generate multiple C files from multiple Python files and then compile them using GCC. Using Python3.10 on Ubuntu 22.04 my tool flow works fine. When I switch to Kubuntu 20.04 with ...
0 votes
0 answers
46 views
NDI Forwarding with cyndilib forwards video but no audio — audio missing in forwarded stream
I’m using cyndilib (v0.0.6) on Windows to receive an NDI source and then forward it in a different resolution(this is just one of my use-cases, there are a lot others). The problem that I'm unable to ...
0 votes
0 answers
32 views
Cython: getline - unresolved externals?
I tried to use Cython to read a binary file line by line, but got errors during compiling the codes, due to, probably, getline. Simple test codes are as follows: # test_getline_cython.pyx cimport ...
1 vote
2 answers
93 views
How to exploit sparsity with lists in a Cython function
I have a function I need to implement which does not vectorize well, and so I am implementing it in Cython to make the nested for-loops workable. My problem is of a similar complexity as naive matrix-...
0 votes
0 answers
79 views
How to freeze Python build tools for repeatable builds?
TL;DR: When pip install builds and installs wheels, how do I determine which versions of build tool packages (e.g. Cython) it used? How do I force it to use the same versions of those packages in the ...
1 vote
1 answer
69 views
profile=True not working on my machine, but is working in google colab
I am trying to get profile=True and %%prun to give a profile of the runtime for the compiled cython program. But on my Windows machine it is not working, the same code works on google colab. Cython ...
0 votes
1 answer
43 views
Cython *.pxd file cannot use absolute imports for Cython submodule
I am getting an Error compiling Cython file, 'myproject/utils/hdf5.pxd' not found` when trying to build my Cython project in a certain way. My Cython project is organized this way: myproject/ setup....
0 votes
1 answer
414 views
Python package install fails on docker image python:3.11-alpine : Error compiling cython file
I just had a problem that started Monday 12/05/2025, i have a custom python package on a registry that i've been using since a while, the installation of this package with pip on docker base image ...
0 votes
0 answers
460 views
Can nuitka/cython programs be reversed technically
As is known to all, Nuitka and Cython compiles Python bytecodes to C/C++. Technically, can Python applications nuitka/cython programs be reversed?