AttributeError: module 'h.cli.commands' has no attribute 'authclient'

20 views
Skip to first unread message

David Dye

unread,
Dec 15, 2021, 1:40:03 PM12/15/21
to pylons-discuss
Hi - I am using python 3.6.9 and pyramid 2.0 and getting this error.  Any ideas what I am doing wrong here?  I searched conversations for "authclient" as well as the documentation and did not see anything.  Thank you very much.  

Traceback (most recent call last):
  File "/home/ec2-user/.local/lib/python3.6/site-packages/pyramid/path.py", line 387, in _zope_dottedname_style
    found = getattr(found, n)
AttributeError: module 'h.cli.commands' has no attribute 'authclient'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/ec2-user/h/h/__main__.py", line 4, in <module>
    main()
  File "/home/ec2-user/h/h/cli/__init__.py", line 71, in main
    cli.add_command(resolver.resolve(cmd))
  File "/home/ec2-user/.local/lib/python3.6/site-packages/pyramid/path.py", line 307, in resolve
    return self._resolve(dotted, package)
  File "/home/ec2-user/.local/lib/python3.6/site-packages/pyramid/path.py", line 334, in _resolve
    return self._zope_dottedname_style(dotted, package)
  File "/home/ec2-user/.local/lib/python3.6/site-packages/pyramid/path.py", line 389, in _zope_dottedname_style
    __import__(used)
  File "/home/ec2-user/h/h/cli/commands/authclient.py", line 4, in <module>
    from h.security import token_urlsafe
  File "/home/ec2-user/h/h/security/__init__.py", line 10, in <module>
    from h.security.identity import Identity  # noqa:F401
  File "/home/ec2-user/h/h/security/identity.py", line 3, in <module>
    from dataclasses import dataclass
ModuleNotFoundError: No module named 'dataclasses'

David Dye

unread,
Dec 15, 2021, 1:40:03 PM12/15/21
to pylons-discuss
Hi - I am using python 3.6.9 and pyramid 2.0.  I searched the docs and these converstations but did not find "authclient".  Any ideas what I may be doing wrong?  Thank you very much!

Theron Luhn

unread,
Dec 15, 2021, 1:44:30 PM12/15/21
to 'Jonathan Vanasco' via pylons-discuss
It looks like the root of the error is attempting to import dataclasses in your "security/identity.py” file.

Dataclasses were added in 3.7, so you’ll need to upgrade Python (would recommend, 3.6 is EOL in a year) or install the backport. https://pypi.org/project/dataclasses/

— Theron



--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/1862156c-bc90-45be-988b-811913b8dba7n%40googlegroups.com.

Steve Piercy

unread,
Dec 15, 2021, 1:50:15 PM12/15/21
to pylons-...@googlegroups.com
Python 3.6 is EOL in 8 days.

https://devguide.python.org/#status-of-python-branches

--steve


On 12/15/21 10:44 AM, Theron Luhn wrote:
> It looks like the root of the error is attempting to import dataclasses in your "security/identity.py” file.
>
> Dataclasses were added in 3.7, so you’ll need to upgrade Python (would recommend, 3.6 is EOL in a year) or install the backport. https://pypi.org/project/dataclasses/ <https://pypi.org/project/dataclasses/>
>> To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com <mailto:pylons-discus...@googlegroups.com>.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/1862156c-bc90-45be-988b-811913b8dba7n%40googlegroups.com <https://groups.google.com/d/msgid/pylons-discuss/1862156c-bc90-45be-988b-811913b8dba7n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com <mailto:pylons-discus...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/F667FF52-5FC1-46DB-8ACB-084AB28C4AE3%40luhn.com <https://groups.google.com/d/msgid/pylons-discuss/F667FF52-5FC1-46DB-8ACB-084AB28C4AE3%40luhn.com?utm_medium=email&utm_source=footer>.

Bert JW Regeer

unread,
Dec 15, 2021, 2:03:34 PM12/15/21
to pylons-...@googlegroups.com
David,

That is an issue with the code you are running, not with Pyramid. “h” is attempting to import “dataclasses” which were introduced in Python 3.7, and are not available in Python 3.6. You will need to upgrade your Python version to version 3.7 before you can run that code.

I assume you are using hypothesis/h and are attempting to run it, since I found the code here:


For further support you will need to contact the authors of https://github.com/hypothesis/h, they do have a detailed document on how to run h in your own development environment: https://h.readthedocs.io/en/latest/developing/install/

Thanks,
Bert JW Regeer

--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/0e9e04ad-73ce-4e36-98bf-5f83530e011en%40googlegroups.com.

signature.asc

David Dye

unread,
Dec 15, 2021, 2:16:25 PM12/15/21
to pylons-discuss
thank you very much all.  
Reply all
Reply to author
Forward
0 new messages