'Export python output to password protected zip file?

I'm on the last step of a program that I have been creating. I have to export the output of my python program as a password protected zip file (I have been following these instructions). I was looking to use the pyminizip package to do so, but it will not install on my mac. The following error message appears in my terminal:

error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [13 lines of output]
      running bdist_wheel
      running build
      running build_ext
      building 'pyminizip' extension
      creating build
      creating build/temp.macosx-10.9-universal2-3.10
      creating build/temp.macosx-10.9-universal2-3.10/src
      creating build/temp.macosx-10.9-universal2-3.10/zlib-1.2.11
      creating build/temp.macosx-10.9-universal2-3.10/zlib-1.2.11/contrib
      creating build/temp.macosx-10.9-universal2-3.10/zlib-1.2.11/contrib/minizip
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -Isrc -Izlib-1.2.11 -Izlib-1.2.11/contrib/minizip -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c src/py_miniunz.c -o build/temp.macosx-10.9-universal2-3.10/src/py_miniunz.o
      xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyminizip
  Running setup.py clean for pyminizip
Failed to build pyminizip
Installing collected packages: pyminizip
  Running setup.py install for pyminizip ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for pyminizip did not run successfully.
  │ exit code: 1
  ╰─> [13 lines of output]
      running install
      running build
      running build_ext
      building 'pyminizip' extension
      creating build
      creating build/temp.macosx-10.9-universal2-3.10
      creating build/temp.macosx-10.9-universal2-3.10/src
      creating build/temp.macosx-10.9-universal2-3.10/zlib-1.2.11
      creating build/temp.macosx-10.9-universal2-3.10/zlib-1.2.11/contrib
      creating build/temp.macosx-10.9-universal2-3.10/zlib-1.2.11/contrib/minizip
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -Isrc -Izlib-1.2.11 -Izlib-1.2.11/contrib/minizip -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c src/py_miniunz.c -o build/temp.macosx-10.9-universal2-3.10/src/py_miniunz.o
      xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pyminizip

Having no clue how to even deal with packages, I am a bit confused in terms of how to approach the issue. Is this because I have a mac, and if so, what other approach could I take to export my list as a password protected zip file?



Solution 1:[1]

This problem was simply solved by creating a virtual environment in vscode.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 bellbottoms