mikeyEcology / MLWIC

Machine Learning for Wildlife Image Classification
70 stars 16 forks source link

Error in setup function: invalid version specification ‘2.7.15rc1’ #26

Closed schamaille closed 5 years ago

schamaille commented 5 years ago

I am trying to install MLWIC on my Linux Mint 19.1 machine, using Python 2.7 At step 4 of the installation, running the setup function of the MLWIC package, I receive the following error (irrespectively of whether I have r_reticulate=T or not, but just in case it's important I have anaconda for python 2.7 installed): Creating virtual environment 'r-reticulate' ... Using python: /usr/bin/python2.7 Error: invalid version specification ‘2.7.15rc1’

I wonder whether there could be any reference to 2.7.15rc1 in the MLWIC code somewhere, as for instance suggested here for an unrelated package (https://codeyarns.com/2017/02/02/invalid-version-number-error-with-python/)? In any case, any hint would be appreciated. Thanks.

mikeyEcology commented 5 years ago

It looks like the Python you have installed in this location is a "release candidate", which is not necessarily the best version of Python. Could you try updating Python on your system? It looks like this is the current version, but any version should be okay as long as it doesn't have the "rc" in the version.

schamaille commented 5 years ago

Hi Mike, thanks. I did update to 2.7.16. As shown by this:

simon@simon-HP-EliteBook-Folio-1040-G3:~$ python2.7 - V Python 2.7.16 (default, Jun 12 2019, 21:53:05) I can launch it at /usr/local/bin/python simon@simon-HP-EliteBook-Folio-1040-G3:~$ /usr/local/bin/python Python 2.7.16 (default, Jun 12 2019, 21:53:05)

However my binary python at /usr/bin/python is still 2.7.15rc1 simon@simon-HP-EliteBook-Folio-1040-G3:~$ /usr/bin/python Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15)

What is surprising is that when running setup(python_loc="usr/local/bin/python", r_reticulate=F) I still get the same error (irrespectively of whether r_reticulate is F or T), as if the python_loc argument was not used, or if the python binary was required by another function later not using the path given. I could symlink the usr/bin/python to usr/local/bin/python, but I am reluctant to do that as it could break stuff on the whole system. Any suggestion welcomed, but this seems more of a problem with my python installation that MLWIC so you could close the issue maybe. I have another Linux machine on which I will also try.

mikeyEcology commented 5 years ago

I'm not familiar with Linux Mint, but one solution would be to remove this rc1 version of Python. But either way, you want to be using the python that was installed with anaconda, so this should be in a location like /anaconda2/python. But I'm not sure where exactly it will be stored on your machine. Can you try opening your terminal and typing which python?

schamaille commented 5 years ago

Sorted at this stage. Pointing to the path of the anaconda python did the job. Thanks for the support.