Cannot install - Win 10, VS Code

I have Windows 10, just installed Visual Studio Code. Now I’m trying to install the PlatformIO IDE extension, but it is failing.

After selecting it from the list of extensions and clicking the install button, it goes through several minutes of stuff, then tells me it is installed, reboot the window. So I click on the link to do that, and get:

console.ts:137 [Extension Host] Error: Error: Traceback (most recent call last):
  File "c:\users\ralph\.platformio\penv\lib\site-packages\platformio\__main__.py", line 102, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "c:\users\ralph\.platformio\penv\lib\site-packages\click\core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\ralph\.platformio\penv\lib\site-packages\click\core.py", line 717, in main
    rv = self.invoke(ctx)
  File "c:\users\ralph\.platformio\penv\lib\site-packages\platformio\commands\__init__.py", line 44, in invoke
    return super(PlatformioCLI, self).invoke(ctx)
  File "c:\users\ralph\.platformio\penv\lib\site-packages\click\core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\ralph\.platformio\penv\lib\site-packages\click\core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\ralph\.platformio\penv\lib\site-packages\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "c:\users\ralph\.platformio\penv\lib\site-packages\platformio\commands\home\command.py", line 51, in cli
    inject_contrib_pysite()
  File "c:\users\ralph\.platformio\penv\lib\site-packages\platformio\managers\core.py", line 111, in inject_contrib_pysite
    addsitedir(contrib_pysite_dir)
  File "c:\users\ralph\.platformio\penv\lib\site.py", line 202, in addsitedir
    addpackage(sitedir, name, known_paths)
  File "c:\users\ralph\.platformio\penv\lib\site.py", line 170, in addpackage
    exec(line)
  File "<string>", line 1, in <module>
AttributeError: module 'os' has no attribute 'add_dll_directory'

============================================================

An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
  `pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section
  https://docs.platformio.org/page/faq.html

* Report this problem to the developers
  https://github.com/platformio/platformio-core/issues

I have search for the “module ‘os’ has no attribute ‘add_dll_directory’” error with no results.

I see there are other installation options; my current project needs me to work on VS Code with the PlatformIO IDE extension. Can I run an external install program and achieve that? Or is there something else I can do to try to solve this?

I have python 3.8.0a1, Windows 10 Pro 10.0.18362 Build 18362. The python was evidently built by one of the installs (VS Code or PlatformIO) I did recently, I didn’t have it before.

Can anyone point me to anything here?

We don’t install Beta Python. Please remove all Python installations from a system and restart VSCode.

1 Like