google-deepmind / alphafold3

AlphaFold 3 inference pipeline.
Other
5.13k stars 576 forks source link

docker run error: Importing the numpy C-extensions failed. #93

Closed carrisonj closed 4 days ago

carrisonj commented 4 days ago

docker run cli as follow: docker run -it --volume $HOME/af_input:/root/af_input --volume $HOME/af_output:/root/af_output --volume $MODEL_PARAMETERS_DIR:/root/models --volume $DB_DIR:/root/public_databases --gpus all alphafold3 python3 run_alphafold.py --json_path=/root/af_input/fold_input.json --model_dir=/root/models --output_dir=/root/af_output

i've add lines below to run_alphafold.py, import os os.environ['OPENBLAS_NUM_THREADS'] = '1' before import numpy as np

still got same error. pls help me, thx a lot.

carrisonj commented 4 days ago

OpenBLAS blas_thread_init: pthread_create failed for thread 63 of 64: Operation not permitted OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max Traceback (most recent call last): File "/alphafold3_venv/lib/python3.11/site-packages/numpy/_core/init.py", line 23, in from . import multiarray File "/alphafold3_venv/lib/python3.11/site-packages/numpy/_core/multiarray.py", line 10, in from . import overrides File "/alphafold3_venv/lib/python3.11/site-packages/numpy/_core/overrides.py", line 8, in from numpy._core._multiarray_umath import ( ImportError: PyCapsule_Import could not import module "datetime"

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/alphafold3_venv/lib/python3.11/site-packages/numpy/init.py", line 114, in from numpy.config import show as show_config File "/alphafold3_venv/lib/python3.11/site-packages/numpy/config.py", line 4, in from numpy._core._multiarray_umath import ( File "/alphafold3_venv/lib/python3.11/site-packages/numpy/_core/init.py", line 49, in raise ImportError(msg) ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed.

We have compiled some common reasons and troubleshooting tips at:

https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help.

Original error was: PyCapsule_Import could not import module "datetime"

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/app/alphafold/run_alphafold.py", line 39, in from alphafold3.common import folding_input File "/alphafold3_venv/lib/python3.11/site-packages/alphafold3/common/folding_input.py", line 23, in from alphafold3 import structure File "/alphafold3_venv/lib/python3.11/site-packages/alphafold3/structure/init.py", line 14, in from alphafold3.structure.bioassemblies import BioassemblyData File "/alphafold3_venv/lib/python3.11/site-packages/alphafold3/structure/bioassemblies.py", line 18, in from alphafold3.structure import mmcif File "/alphafold3_venv/lib/python3.11/site-packages/alphafold3/structure/mmcif.py", line 29, in import numpy as np File "/alphafold3_venv/lib/python3.11/site-packages/numpy/init.py", line 119, in raise ImportError(msg) from e ImportError: Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python interpreter from there.

Augustin-Zidek commented 4 days ago

This is a duplicate of https://github.com/google-deepmind/alphafold3/issues/83, let's continue the discussion there.