Useful or not, from you.
platformio-vscode-ide ImportError: DLL load failed: The specified module could not be found

Description of problem

Leave a comment...

BEFORE SUBMITTING, PLEASE SEARCH FOR DUPLICATES IN

  • https://github.com/platformio/platformio-vscode-ide/issues

Configuration

VSCode: 1.31.1 PIO IDE: v1.6.0 System: Windows_NT, 10.0.17763, x64

Exception

Error: Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 38, in <module>
  File "<string>", line 38, in <module>
  File "<string>", line 18, in load_module
  File "<string>", line 9, in <module>
  File "C:\Users\milo4\.platformio\packages\contrib-pysite\twisted\internet\serialport.py", line 87, in <module>
    from twisted.internet._win32serialport import SerialPort
  File "C:\Users\milo4\.platformio\packages\contrib-pysite\twisted\internet\_win32serialport.py", line 19, in <module>
    import win32file, win32event
ImportError: DLL load failed: The specified module could not be found.

	at P.Promise (C:\Users\milo4\.vscode\extensions\platformio.platformio-ide-1.6.0\node_modules\platformio-node-helpers\dist\index.js:1:14992)
	at ChildProcess.h (C:\Users\milo4\.vscode\extensions\platformio.platformio-ide-1.6.0\node_modules\platformio-node-helpers\dist\index.js:1:5916)
	at ChildProcess.emit (events.js:182:13)
	at ChildProcess.cp.emit (C:\Users\milo4\.vscode\extensions\platformio.platformio-ide-1.6.0\node_modules\cross-spawn\lib\enoent.js:34:29)
	at maybeClose (internal/child_process.js:961:16)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
That's a useful answer
Without any help

I faced the same problem yesterday. I fixed by installing the required modules(pywin32 and PySerial). Since platformio using its own python 2.7 located in ~/.platformio/penv or C:\User\your-username\.platformio\penv, We have to install the missing modules using their copy of python which can be done by using these commands:

> cd C:\Users\your-username\.platformio\penv
> python.exe -m pip install PySerial pywin32

Thank you! It worked for me :)