Closed LinuxUserGD closed 2 years ago
I would like to avoid using pyximport
, as the Cython docs recommend not using it for end-users. The Cython extension should be compiled during pip install.
How and when did you get the ModuleNotFoundError
?
Seems like the cython extension is not compiled during pip install, tried running
python3.10 -m pip install -U "youbit @ git+https://github.com/MeViMo/youbit.git"
python3.10 -m youbit download
edit: works without adding pyximport
after changing setup.py
to
from distutils.core import setup
from Cython.Build import cythonize
setup(
ext_modules = cythonize("youbit/ecc/creedsolo.pyx")
)
Strange. I assume you're on linux and have a C compiler installed?
Strange. I assume you're on linux and have a C compiler installed?
Using gcc (Gentoo 11.3.0 p4) 11.3.0
on Mocaccino OS,
build_ext
is not executed when running python setup.py build_ext
.
The pyproject.toml seems to replace build.py
, so cython extension is only built with pip install
after adding extension to setup_args
I think, see https://stackoverflow.com/a/66479252
from setuptools import setup, Extension
from Cython.Build import cythonize
creedsolo = [Extension('creedsolo', ['youbit/ecc/creedsolo.pyx'], include_dirs = ['youbit/ecc'])]
setup_args = dict(
ext_modules = cythonize(creedsolo)
)
setup(**setup_args)
Note that the setup.py
file is (was) there only for backward compatibility for editable installs.
I just pushed v0.1.4
which just foregoes the setup.py to let Poetry build one when it needs it for a wheel.
Could you try again with pip install youbit==0.1.4 --no-binary :all:
?
If it persists I might have to add a complete setup.py for backward compatibility.
I just pushed
v0.1.4
which just foregoes the setup.py to let Poetry build one when it needs it for a wheel. Could you try again withpip install youbit==0.1.4 --no-binary :all:
? If it persists I might have to add a complete setup.py for backward compatibility.
Thanks, works now with pip install
and creedsolo.cpython-310-x86_64-linux-gnu.so
is included in /usr/lib/python3.10/site-packages/youbit/ecc
Should fix import error "no module named youbit.ecc.creedsolo" and warnings "Index should be typed for more efficient access".