5,352 questions
0
votes
0
answers
15
views
How do I build a project mixed cython and Python by using scikit-build?
In old days, I used setup.py to build my project which hybird cython and plain python. Recently, I've heard that using setup.py to build is not recommend, and pip will remove the support of it ...
0
votes
0
answers
17
views
How do I use cygdb in Conda environment?
I'm trying to run cygdb according to this document. However, the cygdb always seem to find the system python instead of the python of current conda environment, as:
It used the Python interpreter /usr/...
0
votes
0
answers
22
views
Creating pyd for python project [duplicate]
I have simple python project which represents basic inheritance tree.
mypackage:
__init__.py
animal.py (class Animal)
dog.py (class Dog inherited from Animal)
I want to generate 'single' ...
1
vote
1
answer
48
views
Try to write a generic free function in cython, but get an error
error info:
.\tools.c(17775): error C2069: Cast from "void" to non-void
.\tools.c(17775): error C2036: "void *" : unknown size
my code:
This function attempts to free the memory ...
1
vote
0
answers
62
views
"pip install pytetgen" can't find Cython module, but "pip install Cython" shows it is already installed
I have used Spack 0.24.0.dev0 to create an environment that includes Python 3.13.0, and I also used Spack to install several python modules including Cython.
Now I need to install the pytetgen module (...
1
vote
0
answers
10
views
Equivalent to inspect.isFunction and inspect.ismethod that work with cython?
I currently have python 3 code that looks like this:
if inspect.isfunction(type) or inspect.ismethod(type):
# do stuff
unfortunately we ended up getting inconsistent behavior with this logic ...
0
votes
0
answers
25
views
Error 'undefined symbol: _PyUnicode_Ready' after Ubuntu update
I'm using a computer cluster, where all machines are running Ubuntu 24.04 after an update, while the machine I use to access the cluster is running Ubuntu 22.04. The cluster runs with SLURM. In ...
0
votes
0
answers
36
views
errors finding package when using tox for testing with cython extensions
I am using cython to build a module for a library. When I install the package locally, i.e., pip install . I can perfectly import and run the module, however I cannot do that in tox environments.
...
2
votes
1
answer
27
views
Extending numpy random via pyx throws Cython error in converting python object to bitgen_t
I am trying to use the Numpy C-API to extend random numbers through BitGenerator as in the numpy example in the documentation, and I am running into a PyObject cannot be convert to bitgen_t error.
I ...
-1
votes
1
answer
43
views
Complete porting from Python to C/C++ with Cython
I'm working with a Python code (3.12) that uses Sklearn, Numpy and Panda modules.
My goal is to fully convert such Python code into C/C++ code, so avoiding the use of Python due to project ...
1
vote
1
answer
74
views
No enum for numpy uintp?
I am trying to wrap a C pointer array of type size_t with a numpy ndarray via Cython using the following:
cimport numpy as cnp
from libcpp.vector cimport vector
cnp.import_array()
cdef size_t ...
0
votes
1
answer
31
views
`python -m build` can't find numpy include files when running in cibuildwheel
I'm building a python module that contains a cython file which uses numpy. In some environments python -m build works as is; in other environments I need to set C_INCLUDE_PATH=`python -c "import ...
-1
votes
0
answers
22
views
How to install Cython 0.19 successfully when wheel installed doesn't work?
pretty new to python and pip so excuse my ignorance.
I'm trying to install Cython 0.19 for OPstrat https://pypi.org/project/Cython/0.19/ when I inputted pip install Cython==0.19 into cmd it says '...
1
vote
0
answers
40
views
How to properly convert between types in Cython?
I have a function which looks like
cdef double __test_func(double x, double y, double z):
return (x-y)/((2*x-y)*y)**(0.5*z)
def test_func(x, y, z):
return __test_func(<double>x, <...
0
votes
0
answers
41
views
Cython: Pythran as numpy backend on Windows 11
I'm trying to use Pythran as numpy backend in Cython as described here:
Cython Documentation
But unfortunately I run into an issue.
This is my testfile, testfile_cython.pyx:
# -*- coding: utf-8 -*-
# ...