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

macropy.activate fails in Python 3.10.2 #107

Open
danielshub opened this issue Jan 28, 2022 · 4 comments
Open

macropy.activate fails in Python 3.10.2 #107

danielshub opened this issue Jan 28, 2022 · 4 comments

Comments

@danielshub
Copy link

I am unable to use macropy.activate from version 1.1.0b2 in Python 3.10.2 on Arch Linux. When running import macropy.activate I expected Python to cleanly import the package, but instead it gives an error related to lineno.

$ python
Python 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import macropy.activate
Error while compiling file /usr/lib/python3.10/site-packages/macropy/core/hquotes.py
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/macropy/core/import_hooks.py", line 113, in expand_macros
    return compile(tree, filename, "exec"), new_tree
TypeError: required field "lineno" missing from alias
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.10/site-packages/macropy/activate.py", line 4, in <module>
    macropy.activate()
  File "/usr/lib/python3.10/site-packages/macropy/__init__.py", line 18, in activate
    from .core import hquotes  # noqa
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1002, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 945, in _find_spec
  File "/usr/lib/python3.10/site-packages/macropy/core/import_hooks.py", line 147, in find_spec
    code, tree = self.expand_macros(source, origin, spec)
  File "/usr/lib/python3.10/site-packages/macropy/core/import_hooks.py", line 113, in expand_macros
    return compile(tree, filename, "exec"), new_tree
TypeError: required field "lineno" missing from alias
@DestyNova
Copy link

I'm running into the same error here, which prevents Psychopy from running. I don't know how to debug this...

@danielshub
Copy link
Author

@DestyNova I got the problem via PsychoPy/javascripthon also:
https://discourse.psychopy.org/t/what-is-the-state-of-python-3-10-support/27303
https://discourse.psychopy.org/t/psychopy-2021-2-3-1-fails-to-start/27067

The solution for PsychoPy/javascripthon is to use the unreleased version of javascripthon that does not depend on macopy (https://github.com/metapensiero/metapensiero.pj/blob/master/CHANGES.rst)

@DestyNova
Copy link

Thanks @danielshub -- I was falling down the rabbit hole of debugging Macropy but this sounds like a better solution 👍

@tcmulcahy
Copy link

I've opened #108 which addresses this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants