Skip to content

Conversation

JuhPuur
Copy link
Contributor

@JuhPuur JuhPuur commented Sep 5, 2019

Running mbed as a module with python -m (to ensure it's running from virtualenv) with python3 causes the following:

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/juhpuur/mbed-cli/mbed/__main__.py", line 1, in <module>
    from mbed import main
ImportError: cannot import name 'main'

The fix is to add a dot to the import in __main__.py to tell python to search current package before rest of PYTHONPATH.

Copy link
Collaborator

@madchutney madchutney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general I prefer absolute imports but this looks ok.

@OPpuolitaival
Copy link
Contributor

@JuhPuur did run mbed-os ci flow and this seems to work fine

@madchutney madchutney merged commit 6f035de into ARMmbed:master Sep 10, 2019
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 this pull request may close these issues.

3 participants