Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cython does not build .so file

Tags:

python

cython

I'm trying cython for the first time. Here is what I have.

setup.py

import os
from distutils.core import setup
from Cython.Build import cythonize

os.chdir(os.path.dirname(__file__))
setup(ext_modules = cythonize('example123.pyx'))

example123.pyx

def say_hello(name):
    print(f"Hello {name}")

After setup.py build_ext --inplace I only see example123.c in the folder, no other files created. Searching through all the files didn't provide any results. As far as I know, a .so or .pyd file must have appeared to import into a python script. What may be the problem?

My specs: Windows 7 x64, gcc mingw64, python 3.8, cython 0.29.24

like image 950
Kaiyakha Avatar asked Jan 29 '26 11:01

Kaiyakha


1 Answers

remove __init__.py in the current folder if having any

like image 170
Wisper Guo Avatar answered Jan 31 '26 00:01

Wisper Guo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!