CERN / TIGRE

TIGRE: Tomographic Iterative GPU-based Reconstruction Toolbox
BSD 3-Clause "New" or "Revised" License
563 stars 186 forks source link

Fix cython3 issues #478

Closed tsadakane closed 1 year ago

tsadakane commented 1 year ago

Purpose

Fix #471, #472, #473

Test

Environment

AnderBiguri commented 1 year ago

Great! thanks a lot!

Have you tried installing with python setup.py install only? I think if you are using conda you don't need the --user option.

tsadakane commented 1 year ago

The commands below worked fine:

> conda create -n test311 python=3.11
> conda activate test311
> conda install jupyter numpy matplotlib opencv pillow pandas scipy imageio cython pylint
> python setup.py install > Build.log 2>&1
> python example.py

One thing I realized is... before installation, I could not find "pytigre" in the output of "pip list", and after installation, I found two "pytigre" lines.

image

AnderBiguri commented 1 year ago

Thanks for stepping in on this @tsadakane , super appreciated

AnderBiguri commented 1 year ago

@tsadakane its strange, the 2 lines, but I am not sure f this is from our side or something conda/setuptools. We can investigate further, but I am merging because ti solves a critical issue right know. Thanks again.

tsadakane commented 1 year ago

I tried with master@HEAD (before merge) + Python 3.9 + Cython 0.29.

 > conda create -n test39 python=3.9
 > conda activate test39
 > conda install jupyter numpy matplotlib opencv pillow pandas scipy imageio cython==0.29.36 pylint 
 > pip list > pip_list_39.txt
 > python setup.py install > Build.log 2>&1
 > pip list > pip_list_39_after.txt
 > python example.py

After installation, "pip list" output contains only one "pytigre", with "Editable project location" field. Here is a portion of pip_list_39_after.txt

python-json-logger    2.0.7
pytigre               2.4.0     c:\opt\anaconda3\envs\test39\lib\site-packages\pytigre-2.4.0-py3.9-win-amd64.egg
pytz                  2022.7
AnderBiguri commented 1 year ago

@tsadakane it may have to do with the fact that installing via python setup.py is technically deprecated. I think the correct way is pip install . now, but last time I tried that failed.

tsadakane commented 1 year ago

@AnderBiguri , I have succeeded pip install -e . with some modification, and I have just checked "pip list": The result contained only one "pytigre" line.

python-json-logger    2.0.7
pytigre               2.4.0
pytz                  2022.7
AnderBiguri commented 1 year ago

@tsadakane great! I think a next step for TIGRE should be making that the default, and updating the docs. I am away from tomorrow, but if you can make a PR with the code, I'd be happy to update the docs on my way back and merge it :)