3dem / relion

Image-processing software for cryo-electron microscopy
https://relion.readthedocs.io/en/latest/
GNU General Public License v2.0
444 stars 197 forks source link

ModelAngelo relion ModuleNotFoundError #1042

Open perrymil opened 9 months ago

perrymil commented 9 months ago

I am attempting to install relion ver5.0 on our HPC cluster running rhel7.

We use spack to build and install software, and I attempted to update the existing spack package to use the new ver5.0 branch

After installing it, when running it errors out with the below:

Attempting to download weights for ModelAngelo...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'model_angelo'

---------------------------------- PYTHON ERROR ---------------------------------
   Has RELION been provided a Python interpreter with the correct environment?
   The interpreter can be passed to RELION either during Cmake configuration by
     using the Cmake flag -DPYTHON_EXE_PATH=<path/to/python/interpreter>.
   NOTE: For some modules TORCH_HOME needs to be set to find pretrained models

I saw mention of a similar problem,

https://github.com/3dem/relion/issues/1009

But we aren't using the --pipeline-control option to my knowledge. I was thinking it might have something to do with the downloading weights via ftp issue, considering our network blocks insecure ftp connections... but I wasn't sure how to test that.

Additionally, other binaries display a similar error output:

relion_python_fetch_weights --version
Attempting to download weights for class ranker...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'relion_classranker'
[root@exahead2 bin]# relion --version
RELION version: 5.0-beta-0-commit-fb5d7c (debug-build) 
Precision: BASE=double, CUDA-ACC=single 

[root@exahead2 bin]# relion_python_modelangelo --version
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'model_angelo'

---------------------------------- PYTHON ERROR ---------------------------------
   Has RELION been provided a Python interpreter with the correct environment?
   The interpreter can be passed to RELION either during Cmake configuration by
     using the Cmake flag -DPYTHON_EXE_PATH=<path/to/python/interpreter>.
   NOTE: For some modules TORCH_HOME needs to be set to find pretrained models
---------------------------------------------------------------------------------

  Using python executable: /home/exacloud/software/spack/opt/spack/linux-centos7-ivybridge/gcc-8.3.1/python-3.11.6-cdwydhj4tj4arajgtt3yjxliawexctqf/bin/python
biochem-fan commented 9 months ago

Did you set up RELION's Python environment by conda?

perrymil commented 9 months ago

Hi,

No, the spack package should handle managing that environment without need for conda. It worked fine for relion@4.0.x and considering relion needs to run on an HPC environment, conda isn't a great solution to make this available for all of our users without having to redo this for each user. Or at least, I think thats how it should work...

biochem-fan commented 9 months ago

RELION 5.0 assumes you set up a conda environment with the provided environment.yaml. If you don't want to use conda, you need to install required packages yourself and point the Python runtime to RELION by cmake -DPYTHON_EXE_PATH. Probably you need a custom Spark build script but I have never used Spark so I cannot help you.

conda isn't a great solution to make this available for all of our users without having to redo this for each user

No, you just install conda and set up the environment in a common application folder and let others use it. You don't have to make the common folder globally writable.

V3eneno commented 8 months ago

I have the same issue when running blush, problem not fix: ModuleNotFoundError: No module named 'relion_blush'

Something went wrong in the external Python call... Command: relion_python_blush Class3D/job032/run_it001_class001_external_reconstruct.star --gpu ,

---------------------------------- PYTHON ERROR --------------------------------- Has RELION been provided a Python interpreter with the correct environment? The interpreter can be passed to RELION either during Cmake configuration by using the Cmake flag -DPYTHON_EXE_PATH=<path/to/python/interpreter>. NOTE: For some modules TORCH_HOME needs to be set to find pretrained models

Using python executable: /home/ljw/anaconda3/bin/python


Primary job terminated normally, but 1 process returned a non-zero exit code. Per user-direction, the job has been aborted.


mpirun detected that one or more processes exited with non-zero status, thus causing the job to be terminated. The first process to do so was:

Process name: [[5638,1],1] Exit code: 1

And I download a new package from GitHub and replace the old environment.yaml ljw@One:~/relion$ conda env update -f environment.yml Channels:

done #

To activate this environment, use

#

$ conda activate relion-5.0

#

To deactivate an active environment, use

#

$ conda deactivate

biochem-fan commented 8 months ago

@V3eneno Your Python interpreter for the relion-5.0 conda environment is /home/ljw/anaconda3/envs/relion-5.0/bin/python but apparently you have specified /home/ljw/anaconda3/bin/python during installation. Fix this mismatch by rebuilding RELION with cmake -DPYTHON_EXE_PATH=/home/ljw/anaconda3/envs/relion-5.0/bin/python. Note that you should delete your existing build directory before rerunning this command.

V3eneno commented 8 months ago

Thanks! it fixed!