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

Running the cli command fails with trace #288

Closed
ShocKwav3 opened this issue Feb 20, 2022 · 3 comments · Fixed by #289
Closed

Running the cli command fails with trace #288

ShocKwav3 opened this issue Feb 20, 2022 · 3 comments · Fixed by #289

Comments

@ShocKwav3
Copy link

Hi,

I am fairly new to micropython development and so far it's great. I was trying to setup the micropy-cli in order to get my vscode stop complaining about those errors. Unfortunately, I can't run the any command micropy-cli. They fails with the following error trace:


Traceback (most recent call last):
  File "/Users/ferojother/Library/Python/3.10/bin/micropy", line 5, in <module>
    from micropy.cli import cli
  File "/Users/ferojother/Library/Python/3.10/lib/python/site-packages/micropy/__init__.py", line 18, in <module>
    from micropy import data, lib, project, stubs, utils
  File "/Users/ferojother/Library/Python/3.10/lib/python/site-packages/micropy/project/__init__.py", line 5, in <module>
    from . import modules
  File "/Users/ferojother/Library/Python/3.10/lib/python/site-packages/micropy/project/modules/__init__.py", line 9, in <module>
    from .templates import TemplatesModule
  File "/Users/ferojother/Library/Python/3.10/lib/python/site-packages/micropy/project/modules/templates.py", line 7, in <module>
    from micropy.project.template import TemplateProvider
  File "/Users/ferojother/Library/Python/3.10/lib/python/site-packages/micropy/project/template.py", line 11, in <module>
    from jinja2 import Environment, FileSystemLoader
  File "/Users/ferojother/Library/Python/3.10/lib/python/site-packages/jinja2/__init__.py", line 12, in <module>
    from .environment import Environment
  File "/Users/ferojother/Library/Python/3.10/lib/python/site-packages/jinja2/environment.py", line 25, in <module>
    from .defaults import BLOCK_END_STRING
  File "/Users/ferojother/Library/Python/3.10/lib/python/site-packages/jinja2/defaults.py", line 3, in <module>
    from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
  File "/Users/ferojother/Library/Python/3.10/lib/python/site-packages/jinja2/filters.py", line 13, in <module>
    from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/Users/ferojother/Library/Python/3.10/lib/python/site-packages/markupsafe/__init__.py)

Any pointers on how I can fix this?

Thanks.

@BradenM
Copy link
Owner

BradenM commented Feb 21, 2022

Hi @ShocKwav3, thanks for the report.
Looks like micropy got bit by pallets/jinja#1585.

Will have a fix out soon. Thanks.

@lukich48
Copy link

@ShocKwav3 you can downgrade markupsafe to version 2.0.1 while fix is preparing

pip install --upgrade markupsafe==2.0.1

@BradenM BradenM pinned this issue Mar 14, 2022
@BradenM
Copy link
Owner

BradenM commented Mar 15, 2022

@ShocKwav3 @lukich48

This should be fixed in the latest release candidate (v4.0.0.rc.1).
Would be awesome if any of you guys could give it a try and let me know of any issues 😄

Do note that (as of now) the v4 candidate does not support creating stubs on Windows when using python 3.10 (anything <=3.9 is supported). This is due to rshell depending on pyreadline, which breaks on windows w/ py 3.10.

That said, I am working on a big improvement to how micropy talks with pyboards with support for using either rshell or https://github.com/Carglglz/upydevice as backends. This will support windows+py3.10 and (in the future) bridge into new features such as #228 / #107. Aiming to have this out prior to a final v4 release.

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

Successfully merging a pull request may close this issue.

3 participants