Pythonista-Issues icon indicating copy to clipboard operation
Pythonista-Issues copied to clipboard

Supplied Yaml not compatible with Python 3.10

Open jmmelko opened this issue 2 years ago • 3 comments
trafficstars

python 3.10.4 Pythonista 3.4 Site-package Yaml is 3.11

AttributeError: module 'collections' has no attribute 'Hashable'

Solution #1: upgrade YAML, see https://github.com/yaml/pyyaml/commit/9959328b41ee577c6f14e3a0184b07dd0ecadb8c

alternative solution: copy the yaml directory from site-packages (built-in) into site-packages and manually edit the constructor.py file by importing Hashable from collections.abc instead of collections

(to copy the directory either use cp after installing stash, or write a Python script to do it; absolute location of the yaml directory is shown in the error Traceback)

jmmelko avatar Aug 15 '23 07:08 jmmelko

You must have an old version of StaSH.

# Python 3.10 has put Hashable in collections.abc instead of collections
import collections
collections.Hashable = collections.abc.Hashable

ywangd/stash#462

cclauss avatar Aug 15 '23 19:08 cclauss

StaSh v0.7.5 on python 3.10.4

btw, what’s the relationship with stash? I am talking about yaml and Python there…

jmmelko avatar Aug 17 '23 04:08 jmmelko

Please provide the yaml that you are trying to use so that we can reproduce your results.

cclauss avatar Aug 17 '23 11:08 cclauss