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

ModuleNotFoundError: No module named 'platformio.device.list.util'; 'platformio.device.list' is not a package: #15

Open
not7cd opened this issue Nov 2, 2022 · 2 comments · May be fixed by #16

Comments

@not7cd
Copy link

not7cd commented Nov 2, 2022

I encountered error during upload on platformio-6.0.1 and ff76a3915224135aafad379817f41edd of this repo.

from platformio.device.list.util import list_logical_devices

ModuleNotFoundError: No module named 'platformio.device.list.util'; 'platformio.device.list' is not a package:
  File "/nix/store/nyg508dcy96nvblv4jxw3m106lv6byxw-platformio-6.0.1/lib/python3.9/site-packages/platformio/builder/main.py", line 184:
    env.SConscript("$BUILD_SCRIPT")
  File "/home/not7cd/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/SConscript.py", line 602:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/not7cd/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/SConscript.py", line 290:
    raise e
  File "/home/not7cd/.platformio/packages/tool-scons/scons-local-4.3.0/SCons/Script/SConscript.py", line 286:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/not7cd/.platformio/platforms/raspberrypi@src-ff76a3915224135aafad379817f41edd/builder/main.py", line 337:
    from platformio.device.list.util import list_logical_devices

I was able to fix that by removing util, ended up with

from platformio.device.list import list_logical_devices

I will elaborate later, it's 3 AM here. Also, I would appreciate request for more data about environment. I use NixOS btw 😭

@not7cd
Copy link
Author

not7cd commented Nov 2, 2022

I think it would be smart to add a try...except statement for this import, to ease out the transition between versions. I'm unsure if this is a change from 6.1.x
Also there is this
https://github.com/platformio/platformio-core/blob/develop/platformio/public.py

not7cd added a commit to not7cd/platformio-core that referenced this issue Nov 2, 2022
ivankravets added a commit to platformio/platformio-core that referenced this issue Nov 2, 2022
* Add list_logical_devices to public

maxgerhardt/platform-raspberrypi#15

* Sort imports

Co-authored-by: Ivan Kravets <[email protected]>
@not7cd
Copy link
Author

not7cd commented Nov 2, 2022

from platformio.public import list_logical_devices should be available in 6.1.6

@not7cd not7cd linked a pull request Nov 2, 2022 that will close this issue
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.

1 participant