dereneaton / ipyrad

Interactive assembly and analysis of RAD-seq data sets
http://ipyrad.readthedocs.io
GNU General Public License v3.0
72 stars 40 forks source link

ipyrad doesn't look for ipcluster in the right place #526

Closed DBrusson closed 12 months ago

DBrusson commented 12 months ago

When trying to use ipyrad, it fails at the begining because it can't find ipcluster:

$ ipyrad -p params-Rj02.txt -s 1234567 -f

 -------------------------------------------------------------
  ipyrad [v.0.9.92]
  Interactive assembly and analysis of RAD-seq data
 -------------------------------------------------------------
Error launching ipcluster for parallelization:
([Errno 2] No such file or directory: '/usr/local/python/python-3.11.4/bin/ipcluster')

The problem is ipcluster is in $HOME/.local/bin/ipcluster. PATH, PYTHONPACKAGES and PYTHONPATH are correctly set, so why is it looking in the wrong place ?

isaacovercast commented 12 months ago

It's looking in /usr/local for the ipcluster launcher, which indicates that the conda env isn't correctly configured in your path. Can you show echo $PATH?

You say ipcluster is installed in $HOME/.local/bin, is this where conda is installed or are you using an alternate configuration (not a conda environment)?

It might just be easier to rm -rf .ipython and then remove your minconda install and reinstall miniconda from scratch, if this is something youre comfortable with it usually fixes most weird install problems.

DBrusson commented 12 months ago

I'm not using conda. But I found the bug. It's in ipyrad/core/Parallel.py, line 27 :

IPCLUSTER_BIN = os.path.join(sys.prefix, "bin", "ipcluster")

It doesn't work if the package are bit in the same location as the python executable, which is the case on our cluster. I did a patch that seems to work (but I'm a total noob in Python, I guess it can be better):

IPCLUSTER_BIN=os.popen('which ipcluster').read().strip()

which ipcluster will locate ipcluster in PATH .read() will store the results in IPCLUSTER_BIN .strip() will remove \n from the result

isaacovercast commented 12 months ago

Ahh, cool, that makes sense. That is a fine solution for your needs, it makes sense. Glad you figured it out!

Thanks for letting me know. Good luck with the rest of the assembly!