Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
carrisonj opened this issue Nov 21, 2024 · 2 comments
Closed

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

carrisonj opened this issue Nov 21, 2024 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@carrisonj
Copy link

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
Copy link
Author

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:

  • The Python version is: Python3.11 from "/alphafold3_venv/bin/python3"
  • The NumPy version is: "2.1.3"

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 Augustin-Zidek added the duplicate This issue or pull request already exists label Nov 21, 2024
@Augustin-Zidek
Copy link
Collaborator

This is a duplicate of #83, let's continue the discussion there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants