Closed semvijverberg closed 1 year ago
Dear Sem,
This seems very strange. I have run the same command on mamba, and works without problems. Running the same operating system. Maybe you could try to delete the mamba cache and try the operation again.
The saw the issue with pip not picking up on the dependencies. I have been trying to resolve this, but haven't managed yet. What if you try the following.
mamba create -n test pip
mamba activate test
pip install packaging numpy cython
pip install sklearn-quantile
This works for me and installs the latest version of sklearn-quantile (v0.0.21). Let me know if you manage to make this work.
Cheers, Jasper
Also, which cython version did you use for compilation when taking the pypi route?
Dear Jasper,
Thanks for your help!
I copied and executed:
mamba create -n test pip
mamba activate test
pip install packaging numpy cython
pip install sklearn-quantile
Unfortunately I got the identical Cython error. The Cython version it installed is 3.0.2.
Maybe it relates to my Mac M2 chip / Cython compatibility? I will google a bit.
FYI, I forked the repo and managed to install it when changing the datatypes from np.ulong_t
to int
. I have no experience with Cython code, so I was just wildly guessing here. However, newer versions of Cython gives an error, I also had to degrade the Cython version to 0.29.34.
cdef struct IndexedElement:
int index
np.float32_t value
cdef int _compare(const_void *a, const_void *b):
cdef np.float32_t v
if isnan((<IndexedElement*> a).value): return 1
if isnan((<IndexedElement*> b).value): return -1
v = (<IndexedElement*> a).value-(<IndexedElement*> b).value
if v < 0: return -1
if v >= 0: return 1
cdef long[:] argsort(float[:] data) nogil:
"""source: https://github.com/jcrudy/cython-argsort/blob/master/cyargsort/argsort.pyx"""
cdef int i
cdef int n = data.shape[0]
cdef long[:] order
My current solution:
conda create -n test pip
conda activate test
pip install packaging numpy cython==0.29.34
pip install "git+https://github.com/Beyond-Weather-Git/sklearn-quantile.git"
I updated the setup.cfg to pyproject.toml (which allows to specify installations (Cython + numpy) that are needed for the build (installation of sklearn-quantile).
pip install git+https://github.com/Beyond-Weather-Git/sklearn-quantile.git@updated_pyproject_toml
Thanks for the update. I have checked the numpy documentation and they suggest moving from np.ulong_t
to np.intp_t
. I just tested it with the new Cython version, and that compiled without issues. That seems much cleaner than depending on an old version of Cython.
I never used pyproject.toml. Do you think that is recognised by conda-forge?
Dear Jasper,
Thanks for the update!
I believe they are currently working on pyproject support: https://github.com/conda/conda/issues/12462
I have updated the code and pushed everything to PyPI and conda (version 0.0.29). It should now again be installable without issues. I will close this issue, if it persists feel free to reopen.
Dear Jasper,
I tried to install the package via conda and pip, and neither options seem to work.
mamba create --name test -c conda-forge sklearn-quantile
gives:
Looking for: ['sklearn-quantile']
Installing it via pip gives the error that Cython was not install, after explicitly installing it, it give the error that numpy was not installed. (I was thinking it was not correctly resolving the dependencies.) After installing numpy, it said:
I hope this helps.
Here also some system information: