PlatformIO Community

Pio home crashed: ModuleNotFoundError

Error messages:

Error: Traceback (most recent call last):
  File "D:\msys64\mingw64\lib\python3.8\site-packages\platformio\__main__.py", line 102, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "D:\msys64\mingw64\lib\python3.8\site-packages\click\core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "D:\msys64\mingw64\lib\python3.8\site-packages\click\core.py", line 717, in main
    rv = self.invoke(ctx)
  File "D:\msys64\mingw64\lib\python3.8\site-packages\platformio\commands\__init__.py", line 44, in invoke
    return super(PlatformioCLI, self).invoke(ctx)
  File "D:\msys64\mingw64\lib\python3.8\site-packages\click\core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "D:\msys64\mingw64\lib\python3.8\site-packages\click\core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "D:\msys64\mingw64\lib\python3.8\site-packages\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "D:\msys64\mingw64\lib\python3.8\site-packages\platformio\commands\home\command.py", line 52, in cli
    from autobahn.twisted.resource import WebSocketResource
  File "C:\Users\mafumafu\.platformio\packages\contrib-pysite\autobahn\twisted\__init__.py", line 58, in <module>
    from autobahn.twisted.wamp import ApplicationSession
  File "C:\Users\mafumafu\.platformio\packages\contrib-pysite\autobahn\twisted\wamp.py", line 50, in <module>
    from autobahn.wamp import protocol, auth
  File "C:\Users\mafumafu\.platformio\packages\contrib-pysite\autobahn\wamp\auth.py", line 43, in <module>
    from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
  File "C:\Users\mafumafu\.platformio\packages\contrib-pysite\cryptography\hazmat\primitives\kdf\pbkdf2.py", line 12, in <module>
    from cryptography.hazmat.primitives import constant_time
  File "C:\Users\mafumafu\.platformio\packages\contrib-pysite\cryptography\hazmat\primitives\constant_time.py", line 11, in <module>
    from cryptography.hazmat.bindings._constant_time import lib
ModuleNotFoundError: No module named 'cryptography.hazmat.bindings._constant_time'

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

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

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

Operation system: Windows 10
Python intepreter: 3.8.0 [GCC 9.2.0 64 bit (AMD64)] on win 32

I promise the version of platformio is latest!

Proved by pip:

 λ pip install platformio -U                                                                                                                                                                  
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple                                                                                                                                 
Requirement already up-to-date: platformio in d:\msys64\mingw64\lib\python3.8\site-packages (4.1.0)                                                                                          
Requirement already satisfied, skipping upgrade: colorama in d:\msys64\mingw64\lib\python3.8\site-packages (from platformio) (0.4.1)                                                         
Requirement already satisfied, skipping upgrade: semantic-version<3,>=2.8.1 in d:\msys64\mingw64\lib\python3.8\site-packages (from platformio) (2.8.2)                                       
Requirement already satisfied, skipping upgrade: bottle<0.13 in d:\msys64\mingw64\lib\python3.8\site-packages (from platformio) (0.12.17)                                                    
Requirement already satisfied, skipping upgrade: requests<3,>=2.4.0 in d:\msys64\mingw64\lib\python3.8\site-packages (from platformio) (2.22.0)                                              
Requirement already satisfied, skipping upgrade: pyserial!=3.3,<4,>=3 in d:\msys64\mingw64\lib\python3.8\site-packages (from platformio) (3.4)                                               
Requirement already satisfied, skipping upgrade: marshmallow<3,>=2.20.5 in d:\msys64\mingw64\lib\python3.8\site-packages (from platformio) (2.20.5)                                          
Requirement already satisfied, skipping upgrade: click<8,>=5 in d:\msys64\mingw64\lib\python3.8\site-packages (from platformio) (7.0)                                                        
Requirement already satisfied, skipping upgrade: tabulate<1,>=0.8.3 in d:\msys64\mingw64\lib\python3.8\site-packages (from platformio) (0.8.5)                                               
Requirement already satisfied, skipping upgrade: pyelftools<1,>=0.25 in d:\msys64\mingw64\lib\python3.8\site-packages (from platformio) (0.25)                                               
Requirement already satisfied, skipping upgrade: chardet<3.1.0,>=3.0.2 in d:\msys64\mingw64\lib\python3.8\site-packages (from requests<3,>=2.4.0->platformio) (3.0.4)                        
Requirement already satisfied, skipping upgrade: idna<2.9,>=2.5 in d:\msys64\mingw64\lib\python3.8\site-packages (from requests<3,>=2.4.0->platformio) (2.8)                                 
Requirement already satisfied, skipping upgrade: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in d:\msys64\mingw64\lib\python3.8\site-packages (from requests<3,>=2.4.0->platformio) (1.25.6)     
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in d:\msys64\mingw64\lib\python3.8\site-packages (from requests<3,>=2.4.0->platformio) (2019.9.11)                       

Proved by pio update

λ pio upgrade                                              
You're up-to-date!                                         
PlatformIO 4.1.0 is currently the newest version available.

It seems like the absence of cryptography, but there’s no use after I install it via pip.

λ pip install cryptography
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: cryptography in d:\msys64\mingw64\lib\python3.8\site-packages (2.8)
Requirement already satisfied: six>=1.4.1 in d:\msys64\mingw64\lib\python3.8\site-packages (from cryptography) (1.13.0)
Requirement already satisfied: cffi!=1.11.3,>=1.8 in d:\msys64\mingw64\lib\python3.8\site-packages (from cryptography) (1.13.2)
Requirement already satisfied: pycparser in d:\msys64\mingw64\lib\python3.8\site-packages (from cffi!=1.11.3,>=1.8->cryptography) (2.19)

This is a bug, see