fitter icon indicating copy to clipboard operation
fitter copied to clipboard

Dependency "easydev" unmarked on conda

Open galvanized opened this issue 3 years ago • 3 comments
trafficstars

I encountered this error while trying to run this code:

from fitter import Fitter
f = Fitter(data) # data already assigned
f.fit()
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
/tmp/ipykernel_2933790/2066230846.py in <module>
      4 f = Fitter(data)
----> 5 f.fit()

~/anaconda3/envs/tfp/lib/python3.7/site-packages/fitter/fitter.py in fit(self, amp, progress)
    259         warnings.filterwarnings("ignore", category=RuntimeWarning)
    260 
--> 261         from easydev import Progress
    262         N = len(self.distributions)
    263         pb = Progress(N)

ModuleNotFoundError: No module named 'easydev'

I had installed Fitter with conda install -c bioconda fitter.

The issue is resolved by installing easydev. conda install -c conda-forge easydev.

If the conda package can't be made to install all its dependencies, it'd be good to have a mention of this in the installation instructions.

galvanized avatar Aug 04 '22 21:08 galvanized

Going back through my install history and found that the version of fitter is bioconda/noarch::fitter-1.2.3-pyh145b6a8_0. In case it matters, my conda environment is using python 3.7.13.

galvanized avatar Aug 04 '22 22:08 galvanized

@galvanized I'm surprised, I have done a quick test:

conda create --name fitter fitter

and it works for me. I believe this is related to the python version. In my case, By default v3.10 of python is installed and fitter/easydev are installed automatically. I see that you installed version of fitter is 1.2.3 and I believe the issue is fixed in 1.4.0 that is the latest on conda. I have now also tests with python 3.7.13 without any issues. So I believe you should try with the latest version. I'm surprised though that your conda did not install the latest version. What is your platform ? mac/windows/linux ? Here, I see that the 'noarch' is used so it should not matter.

cokelaer avatar Aug 05 '22 06:08 cokelaer

Platform is Ubuntu 20.04.4 LTS. It seems channel-related. I have not added any extra channels to my .condarc and am including them using the -c flag. Doing conda create --name fitter -c bioconda fitter gives the same problem as earlier: installing fitter bioconda/noarch::fitter-1.2.3-pyh145b6a8_0 instead of the latest, and no easydev.

The correct command seems to be conda create --name fitter -c bioconda -c conda-forge fitter, it installs both packages.

 easydev            conda-forge/noarch::easydev-0.12.0-pyh6c4a22f_0
 fitter             bioconda/noarch::fitter-1.4.0-pyh5e36f6f_0

After installing this way, everything runs as expected. The trick is that fitter needs both the bioconda and conda-forge channels. As someone that doesn't usually use bioconda, I didn't know that it should be used in conjunction with conda-forge. It's clear enough on their website but I didn't think to check there.

galvanized avatar Aug 06 '22 13:08 galvanized

@galvanized thanks for reporting this detailled solution. I did not know about that specific needs from using the two channels. In the next release, easydev will be replaced by a more standard package but the issue may be similar. thanks again

cokelaer avatar Sep 14 '22 20:09 cokelaer