Error running GTDB-Tk v2.1.1: AttributeError: module 'numpy' has no attribute 'bool'

I followed the example, and obtained the two genomes (a and b) and put into the folder tmp/.

Error encountered at the gene-calling step, complaining about numpy if my reading is correct. Please see the log below.

(gtdbtk2.1.1) [maglau@ln01 dsrAB-containing-genomes]$ gtdbtk identify --genome_dir tmp/ --out_dir identify --extension gz --cpus 2
[2023-01-14 23:34:16] INFO: GTDB-Tk v2.1.1
[2023-01-14 23:34:16] INFO: gtdbtk identify --genome_dir tmp/ --out_dir identify --extension gz --cpus 2
[2023-01-14 23:34:16] INFO: Using GTDB-Tk reference data version r207: /data/db/gtdbtk_R207_v2/release207_v2/
[2023-01-14 23:34:17] INFO: Identifying markers in 2 genomes with 2 threads.
[2023-01-14 23:34:17] TASK: Running Prodigal V2.6.3 to identify genes.
==> Processed 0/2 genomes (0%) | | [?genome/s, ETA ?]/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/site-packages/gtdbtk/biolib_lite/prodigal_biolib.py:378: FutureWarning: In the future np.bool will be defined as the corresponding NumPy scalar. (This may have returned Python scalars in past versions.
coding_base_mask = np.zeros(self.last_coding_base[seq_id], dtype=np.bool)
Process Process-2:1:1:
Traceback (most recent call last):
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/multiprocessing/process.py”, line 315, in _bootstrap
self.run()
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/multiprocessing/process.py”, line 108, in run
self._target(*self._args, **self._kwargs)
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/site-packages/gtdbtk/biolib_lite/parallel.py”, line 107, in __producer
rtn = producer_callback(dataItem)
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/site-packages/gtdbtk/biolib_lite/prodigal_biolib.py”, line 147, in _producer
prodigalParser = ProdigalGeneFeatureParser(gff_file_tmp)
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/site-packages/gtdbtk/biolib_lite/prodigal_biolib.py”, line 322, in init
self.coding_base_masks[seq_id] = self.__build_coding_base_mask(
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/site-packages/gtdbtk/biolib_lite/prodigal_biolib.py”, line 378, in __build_coding_base_mask
coding_base_mask = np.zeros(self.last_coding_base[seq_id], dtype=np.bool)
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/site-packages/numpy/init.py”, line 284, in getattr
raise AttributeError("module {!r} has no attribute "
AttributeError: module ‘numpy’ has no attribute ‘bool’
Process Process-2:
Traceback (most recent call last):
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/multiprocessing/process.py”, line 315, in _bootstrap
self.run()
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/multiprocessing/process.py”, line 108, in run
self._target(*self._args, **self._kwargs)
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/site-packages/gtdbtk/external/prodigal.py”, line 143, in _worker
rtn_files = self._run_prodigal(genome_id, file_path, usr_tln_table)
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/site-packages/gtdbtk/external/prodigal.py”, line 109, in _run_prodigal
raise Exception(“An error was encountered while running Prodigal.”)
Exception: An error was encountered while running Prodigal.
[2023-01-14 23:34:22] ERROR: Controlled exit resulting from an unrecoverable error or warning.

================================================================================
EXCEPTION: ProdigalException
MESSAGE: An exception was caught while running Prodigal: Prodigal returned a non-zero exit code.


Traceback (most recent call last):
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/site-packages/gtdbtk/external/prodigal.py”, line 211, in run
raise ProdigalException(‘Prodigal returned a non-zero exit code.’)
gtdbtk.exceptions.ProdigalException: Prodigal returned a non-zero exit code.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/site-packages/gtdbtk/main.py”, line 98, in main
gt_parser.parse_options(args)
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/site-packages/gtdbtk/main.py”, line 839, in parse_options
self.identify(options)
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/site-packages/gtdbtk/main.py”, line 271, in identify
markers.identify(genomes,
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/site-packages/gtdbtk/markers.py”, line 203, in identify
genome_dictionary = prodigal.run(genomes, tln_tables)
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/site-packages/gtdbtk/external/prodigal.py”, line 220, in run
raise ProdigalException(f’An exception was caught while running Prodigal: {e}')
gtdbtk.exceptions.ProdigalException: An exception was caught while running Prodigal: Prodigal returned a non-zero exit code.

(gtdbtk2.1.1) [maglau@ln01 dsrAB-containing-genomes]$ /home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/site-packages/gtdbtk/biolib_lite/prodigal_biolib.py:378: FutureWarning: In the future np.bool will be defined as the corresponding NumPy scalar. (This may have returned Python scalars in past versions.
coding_base_mask = np.zeros(self.last_coding_base[seq_id], dtype=np.bool)
Process Process-3:1:1:
Traceback (most recent call last):
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/multiprocessing/process.py”, line 315, in _bootstrap
self.run()
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/multiprocessing/process.py”, line 108, in run
self._target(*self._args, **self._kwargs)
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/site-packages/gtdbtk/biolib_lite/parallel.py”, line 107, in __producer
rtn = producer_callback(dataItem)
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/site-packages/gtdbtk/biolib_lite/prodigal_biolib.py”, line 147, in _producer
prodigalParser = ProdigalGeneFeatureParser(gff_file_tmp)
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/site-packages/gtdbtk/biolib_lite/prodigal_biolib.py”, line 322, in init
self.coding_base_masks[seq_id] = self.__build_coding_base_mask(
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/site-packages/gtdbtk/biolib_lite/prodigal_biolib.py”, line 378, in __build_coding_base_mask
coding_base_mask = np.zeros(self.last_coding_base[seq_id], dtype=np.bool)
File “/home/maglau/tools/miniconda3/envs/gtdbtk2.1.1/lib/python3.8/site-packages/numpy/init.py”, line 284, in getattr
raise AttributeError("module {!r} has no attribute "
AttributeError: module ‘numpy’ has no attribute ‘bool’

I encountered this problem after re-installation of v2.1.1 (conda), and when using v2.0.0 (conda).

Any luck solving this?

Hey folks,

I hit this too. There was some more help in this github issue. It seems this is a numpy version problem (latest installed versions of numpy are causing it, but an earlier version does not).

Running this in the gtdb conda environment should solve it (this downgrades numpy to v1.23.1):

conda install -c conda-forge numpy=1.23.1

Even though that issue says this will be solved as of version 2.1.2, I put in a pull request to the bioconda recipe for the time being while we’re all still conda-installing things prior to when 2.1.2 is released.

Thanks AstrobioMike. I will try it.

My friend who encountered the same problem. He resolved the issue by doing the following…
install the conda package of v2.1.1
conda activate (gtdbtk2.1.1)
conda update --all

But this does not work for me.

Problem resolved. Thank you, AstrobioMike.

1 Like