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

The mbed device-management command fails with Python 3.8 #14037

Closed
fkjagodzinski opened this issue Dec 11, 2020 · 1 comment · Fixed by #14038
Closed

The mbed device-management command fails with Python 3.8 #14037

fkjagodzinski opened this issue Dec 11, 2020 · 1 comment · Fixed by #14038

Comments

@fkjagodzinski
Copy link
Member

Description of defect

Executing a simple mbed device-management --help command in a clean Python environment fails with:

Traceback (most recent call last):
  File "/home/filip/workspace/mbed-os/tools/device_management.py", line 27, in <module>
    from manifesttool import create, parse, verify, cert, init, update
  File "/home/filip/workspace/mbed-os/venv/lib/python3.8/site-packages/manifesttool/create.py", line 19, in <module>
    from manifesttool.v1.create import main as create_v1
  File "/home/filip/workspace/mbed-os/venv/lib/python3.8/site-packages/manifesttool/v1/create.py", line 37, in <module>
    from manifesttool import utils, codec, errorhandler, defaults
  File "/home/filip/workspace/mbed-os/venv/lib/python3.8/site-packages/manifesttool/utils.py", line 32, in <module>
    from future.moves.urllib.request import urlopen, Request
  File "/home/filip/workspace/mbed-os/venv/lib/python3.8/site-packages/future/moves/urllib/request.py", line 9, in <module>
    from urllib.request import (getproxies,
ImportError: cannot import name 'splitattr' from 'urllib.request' (/usr/lib/python3.8/urllib/request.py)

Target(s) affected by this defect ?

n/a

Toolchain(s) (name and version) displaying this defect ?

n/a

What version of Mbed-os are you using (tag or sha) ?

master (d6784c3)

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

mbed-cli 1.10.5

How is this defect reproduced ?

Follow the steps below. Either run pip install -r requirements.txt or let mbed do it.

$ git reset --hard upstream/master
HEAD is now at d6784c3ee6 Update Mbed version block
$ virtualenv venv
created virtual environment CPython3.8.5.final.0-64 in 91ms
  creator CPython3Posix(dest=/home/filip/workspace/mbed-os/venv, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/filip/.local/share/virtualenv)
    added seed packages: pip==20.3.1, setuptools==51.0.0, wheel==0.36.1
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
$ source venv/bin/activate
$ pip install mbed-cli
$ mbed device-management --help
[mbed] Working path "/home/filip/workspace/mbed-os" (program)
[mbed] WARNING: Could not find mbed program in current path "/home/filip/workspace/mbed-os".
       You can fix this by calling "mbed new ." in the root of your program.
---
[mbed] Auto-installing missing Python modules (pyyaml, jsonschema, mbed_cloud_sdk, jinja2, mbed_ls, mbed_host_tests, mbed_greentea, pyelftools, manifest_tool, icetea, pycryptodome, pyusb, cmsis_pack_manager, psutil, cryptography, click, cbor)...
Traceback (most recent call last):
  File "/home/filip/workspace/mbed-os/tools/device_management.py", line 27, in <module>
    from manifesttool import create, parse, verify, cert, init, update
  File "/home/filip/workspace/mbed-os/venv/lib/python3.8/site-packages/manifesttool/create.py", line 19, in <module>
    from manifesttool.v1.create import main as create_v1
  File "/home/filip/workspace/mbed-os/venv/lib/python3.8/site-packages/manifesttool/v1/create.py", line 37, in <module>
    from manifesttool import utils, codec, errorhandler, defaults
  File "/home/filip/workspace/mbed-os/venv/lib/python3.8/site-packages/manifesttool/utils.py", line 32, in <module>
    from future.moves.urllib.request import urlopen, Request
  File "/home/filip/workspace/mbed-os/venv/lib/python3.8/site-packages/future/moves/urllib/request.py", line 9, in <module>
    from urllib.request import (getproxies,
ImportError: cannot import name 'splitattr' from 'urllib.request' (/usr/lib/python3.8/urllib/request.py)
[mbed] ERROR: "/home/filip/workspace/mbed-os/venv/bin/python" returned error.
       Code: 1
       Path: "/home/filip/workspace/mbed-os"
       Command: "/home/filip/workspace/mbed-os/venv/bin/python -u /home/filip/workspace/mbed-os/tools/device_management.py --help"
       Tip: You could retry the last command with "-v" flag for verbose output
---
@ciarmcom
Copy link
Member

Thank you for raising this detailed GitHub issue. I am now notifying our internal issue triagers.
Internal Jira reference: https://jira.arm.com/browse/IOTOSM-2991

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.

2 participants