You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AttributeError: module 'collections' has no attribute 'Hashable' (conds ainstalaltion with py 10) #873
error reading yaml file pyyaml3 due to python 3.10 mist likely.
AttributeError: module 'collections' has no attribute 'Hashable'
spades.log
System information:
SPAdes version: 3.15.3
Python version: 3.10.0
OS: Linux-5.4.104+-x86_64-with-glibc2.27
Output dir: /content/WD/sample2/assembly
Mode: ONLY assembling (without read error correction)
Debug mode is turned OFF
Dataset parameters:
Metagenomic mode
Reads:
Traceback (most recent call last):
File "/content/databases/conda_envs/91fde30436cb83f9107a310d5f69819a/bin/spades.py", line 659, in
main(sys.argv)
File "/content/databases/conda_envs/91fde30436cb83f9107a310d5f69819a/bin/spades.py", line 599, in main
print_params(log, log_filename, command_line, args, cfg)
File "/content/databases/conda_envs/91fde30436cb83f9107a310d5f69819a/bin/spades.py", line 327, in print_params
print_used_values(cfg, log)
File "/content/databases/conda_envs/91fde30436cb83f9107a310d5f69819a/bin/spades.py", line 117, in print_used_values
dataset_data = pyyaml.load(open(cfg["dataset"].yaml_filename))
File "/content/databases/conda_envs/91fde30436cb83f9107a310d5f69819a/share/spades/pyyaml3/init.py", line 72, in load
return loader.get_single_data()
File "/content/databases/conda_envs/91fde30436cb83f9107a310d5f69819a/share/spades/pyyaml3/constructor.py", line 37, in get_single_data
return self.construct_document(node)
File "/content/databases/conda_envs/91fde30436cb83f9107a310d5f69819a/share/spades/pyyaml3/constructor.py", line 46, in construct_document
for dummy in generator:
File "/content/databases/conda_envs/91fde30436cb83f9107a310d5f69819a/share/spades/pyyaml3/constructor.py", line 398, in construct_yaml_map
value = self.construct_mapping(node)
File "/content/databases/conda_envs/91fde30436cb83f9107a310d5f69819a/share/spades/pyyaml3/constructor.py", line 204, in construct_mapping
return super().construct_mapping(node, deep=deep)
File "/content/databases/conda_envs/91fde30436cb83f9107a310d5f69819a/share/spades/pyyaml3/constructor.py", line 126, in construct_mapping
if not isinstance(key, collections.Hashable):
AttributeError: module 'collections' has no attribute 'Hashable'
I am a novel user of Spades. I solved the error by modifying a python script: Operation Environment
SPAdes version: 3.15.3
Python version: 3.10.1
OS: macOS-12.1-x86_64-i386-64bit
Edited file: ... /share/spades/pyyaml3/constructor.py
Line: line 126 Code was:if not isinstance(key, collections.Hashable):
Code is:if not isinstance(key, collections.abc.Hashable):
Reference Source: https://docs.python.org/3/library/collections.abc.html
"New in version 3.3: Formerly, this module was part of the collections module.
...
This module provides abstract base classes that can be used to test whether a class provides a particular interface; for example, whether it is hashable or whether it is a mapping."
Reacted by Detective-moneill, uesaka, Wesley Franks, Wushi, frunzacatalin76, Stephen Summering, ADamerum, taherzribi, clinch123, cpflueger2016 and 17 more
Reacted by Wesley Franks and Anthony Rende
Reacted by cpflueger2016, Anthony Rende, Tr. 307 and Nichcka
Reacted by cpflueger2016, Anthony Rende and Idowu Olawoye
I am a novel user of Spades. I solved the error by modifying a python script: Operation Environment SPAdes version: 3.15.3 Python version: 3.10.1 OS: macOS-12.1-x86_64-i386-64bit
Edited file: ... /share/spades/pyyaml3/constructor.py Line: line 126 Code was:if not isinstance(key, collections.Hashable):
Code is:if not isinstance(key, collections.abc.Hashable):
Reference Source:https://docs.python.org/3/library/collections.abc.html "New in version 3.3: Formerly, this module was part of the collections module. ... This module provides abstract base classes that can be used to test whether a class provides a particular interface; for example, whether it is hashable or whether it is a mapping."
Hi asl,
I am trying to use spades on mac, installing with bioconda. The latest SPAdes version available for mac osx is the 3.15.2 release. I am experiencing the same attribute error when I try to test my installation of SPAdes.
Do you know if this fix will be available for Mac? the constructor.py script is different to the version listed in the fix above.
Activity
asl commentedon Nov 8, 2021
Thanks, dup of #863
Anushka622001 commentedon Jan 8, 2022
resolve this error
MatthiasWilm commentedon Jan 12, 2022
I am a novel user of Spades. I solved the error by modifying a python script:
Operation Environment
SPAdes version: 3.15.3
Python version: 3.10.1
OS: macOS-12.1-x86_64-i386-64bit
Edited file: ... /share/spades/pyyaml3/constructor.py
Line: line 126
Code was:
if not isinstance(key, collections.Hashable):Code is:
if not isinstance(key, collections.abc.Hashable):Reference Source:
https://docs.python.org/3/library/collections.abc.html
"New in version 3.3: Formerly, this module was part of the collections module.
...
This module provides abstract base classes that can be used to test whether a class provides a particular interface; for example, whether it is hashable or whether it is a mapping."
wesleyfranks commentedon Apr 30, 2022
MattiasWilm your response fixed my issue with AttributeError, thanks.
asl commentedon Apr 30, 2022
This issue was fixed in SPAdes 3.15.4
frunzacatalin76 commentedon Jun 16, 2022
I love you :)
asl commentedon Jun 16, 2022
No need to modify anything. The fix is included into the latest SPAdes 3.15.4 release
CalJMarsh commentedon Jul 13, 2022
Hi asl,
I am trying to use spades on mac, installing with bioconda. The latest SPAdes version available for mac osx is the 3.15.2 release. I am experiencing the same attribute error when I try to test my installation of SPAdes.
Do you know if this fix will be available for Mac? the constructor.py script is different to the version listed in the fix above.
asl commentedon Jul 13, 2022
@CalJMarsh As it was stated above, the fix is included in SPAdes 3.15.4 release. On all platforms Mac included. Check SPAdes manual (https://cab.spbu.ru/files/release3.15.4/manual.html#sec2) for installation guide
dhiru16 commentedon Oct 5, 2022
I got the same error but am using the spades 3.15.5
asl commentedon Oct 5, 2022
@dhiru16 Will you please open a new issue attaching all the files requested?
updated: spades from 3.15.3 to 3.15.5 (fix ablab/spades#873)