cnr-isti-vclab / TagLab

A CNN based image segmentation tool oriented to marine data analysis
https://taglab.isti.cnr.it/
GNU General Public License v3.0
84 stars 33 forks source link

Problem installing TagLab on MacOS with Python 11.X #95

Open benfarmer05 opened 1 year ago

benfarmer05 commented 1 year ago

Here is my error output below. I'm not sure if this is related to my Python version being greater than 10.X?

benfarmer@Daniels-iPro TagLab-main % python3 install.py Traceback (most recent call last): File "/Users/benfarmer/Desktop/TagLab-main/install.py", line 13, in raise Exception("Python " + sys.version_info[0] + "." + sys.version_info[1] + " not supported. Please see https://github.com/cnr-isti-vclab/TagLab/wiki/Install-TagLab")


TypeError: can only concatenate str (not "int") to str
benfarmer@Daniels-iPro TagLab-main % python3 install.py cpu
Traceback (most recent call last):
  File "/Users/benfarmer/Desktop/TagLab-main/install.py", line 13, in <module>
    raise Exception("Python " + sys.version_info[0] + "." + sys.version_info[1] + " not supported. Please see https://github.com/cnr-isti-vclab/TagLab/wiki/Install-TagLab")
                    ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
TypeError: can only concatenate str (not "int") to str
maxcorsini commented 1 year ago

Yes, the problem is that Python 11 is not supported.

fpichardom commented 4 months ago

I see it should raise an exception if it finds a Python version that is not supported. However, the error expression needs to be fixed to make clear to users what is failing: raise Exception("Python " + sys.version_info[0] + "." + sys.version_info[1] + " not supported. The code is incorrect because it raises a TypeError instead of the desired message TypeError: can only concatenate str (not "int") to str. The issue is that sys.version_info[0] and sys.version_info[1] are integers and need to be converted to strings for concatenation. One can use F-strings like: raise Exception(f"Python {sys.version_info[0]}.{sys.version_info[1]} not supported"). This will correctly raise the exception with the message Python 3.11 not supported as it automatically converts integers to string.