cloudmesh / cloudmesh-pi-burn

Burns many SD cards so we can build a Raspberry PI cluster
Other
18 stars 12 forks source link

cms burn branch windows - crypt is not supported on windows #22

Closed jpfleischer closed 2 years ago

jpfleischer commented 2 years ago

When attempting cms burn branch windows on Windows 10, the following output is received:

Traceback (most recent call last):
  File "C:\Users\Sledgehammer\AppData\Local\Programs\Python\Python310\lib\crypt.py", line 6, in <module>
    import _crypt
ModuleNotFoundError: No module named '_crypt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Sledgehammer\AppData\Local\Programs\Python\Python310\lib\pydoc.py", line 439, in safeimport
    module = __import__(path)
  File "C:\Users\Sledgehammer\cloudmesh-pi-burn\cloudmesh\burn\command\burn.py", line 7, in <module>
    from cloudmesh.burn.burner.Burner import Burner
  File "C:\Users\Sledgehammer\cloudmesh-pi-burn\cloudmesh\burn\burner\Burner.py", line 4, in <module>
    from cloudmesh.burn.burner.raspberryos import Burner as RaspberryOsBurner
  File "C:\Users\Sledgehammer\cloudmesh-pi-burn\cloudmesh\burn\burner\raspberryos.py", line 1, in <module>
    import crypt
  File "C:\Users\Sledgehammer\AppData\Local\Programs\Python\Python310\lib\crypt.py", line 9, in <module>
    raise ImportError("The crypt module is not supported on Windows")
ImportError: The crypt module is not supported on Windows

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Sledgehammer\cloudmesh-cmd5\cloudmesh\shell\shell.py", line 170, in <module>
    Plugin.load([name])
  File "C:\Users\Sledgehammer\cloudmesh-cmd5\cloudmesh\shell\shell.py", line 145, in load
    commands = [pydoc.locate(x) for x in classes]
  File "C:\Users\Sledgehammer\cloudmesh-cmd5\cloudmesh\shell\shell.py", line 145, in <listcomp>
    commands = [pydoc.locate(x) for x in classes]
  File "C:\Users\Sledgehammer\AppData\Local\Programs\Python\Python310\lib\pydoc.py", line 1719, in locate
    nextmodule = safeimport('.'.join(parts[:n+1]), forceload)
  File "C:\Users\Sledgehammer\AppData\Local\Programs\Python\Python310\lib\pydoc.py", line 454, in safeimport
    raise ErrorDuringImport(path, sys.exc_info())
pydoc.ErrorDuringImport: problem in cloudmesh.burn.command.burn - ImportError: The crypt module is not supported on Windows

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Sledgehammer\AppData\Local\Programs\Python\Python310\lib\crypt.py", line 6, in <module>
    import _crypt
ModuleNotFoundError: No module named '_crypt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Sledgehammer\AppData\Local\Programs\Python\Python310\lib\pydoc.py", line 439, in safeimport
    module = __import__(path)
  File "C:\Users\Sledgehammer\cloudmesh-pi-burn\cloudmesh\burn\command\burn.py", line 7, in <module>
    from cloudmesh.burn.burner.Burner import Burner
  File "C:\Users\Sledgehammer\cloudmesh-pi-burn\cloudmesh\burn\burner\Burner.py", line 4, in <module>
    from cloudmesh.burn.burner.raspberryos import Burner as RaspberryOsBurner
  File "C:\Users\Sledgehammer\cloudmesh-pi-burn\cloudmesh\burn\burner\raspberryos.py", line 1, in <module>
    import crypt
  File "C:\Users\Sledgehammer\AppData\Local\Programs\Python\Python310\lib\crypt.py", line 9, in <module>
    raise ImportError("The crypt module is not supported on Windows")
ImportError: The crypt module is not supported on Windows

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Sledgehammer\ENV3\Scripts\cms-script.py", line 33, in <module>
    sys.exit(load_entry_point('cloudmesh-cmd5', 'console_scripts', 'cms')())
  File "C:\Users\Sledgehammer\ENV3\Scripts\cms-script.py", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "C:\Users\Sledgehammer\AppData\Local\Programs\Python\Python310\lib\importlib\metadata\__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "C:\Users\Sledgehammer\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Users\Sledgehammer\cloudmesh-cmd5\cloudmesh\shell\shell.py", line 172, in <module>
    Plugin.load()
  File "C:\Users\Sledgehammer\cloudmesh-cmd5\cloudmesh\shell\shell.py", line 145, in load
    commands = [pydoc.locate(x) for x in classes]
  File "C:\Users\Sledgehammer\cloudmesh-cmd5\cloudmesh\shell\shell.py", line 145, in <listcomp>
    commands = [pydoc.locate(x) for x in classes]
  File "C:\Users\Sledgehammer\AppData\Local\Programs\Python\Python310\lib\pydoc.py", line 1719, in locate
    nextmodule = safeimport('.'.join(parts[:n+1]), forceload)
  File "C:\Users\Sledgehammer\AppData\Local\Programs\Python\Python310\lib\pydoc.py", line 454, in safeimport
    raise ErrorDuringImport(path, sys.exc_info())
pydoc.ErrorDuringImport: problem in cloudmesh.burn.command.burn - ImportError: The crypt module is not supported on Windows
(ENV3)
laszewsk commented 2 years ago

wherever its used you need to mask the import such as

if windows: import crypt

or

try: import whatever except Exception as e: print ("if you find a crypt error do something else")

jpfleischer commented 2 years ago

the problem was that i did not update and was using an outdated version of pi burn.