PIO urllib3 NotOpenSSLWarning

It would be helpful to know which Python the VSCode PIO uses when installed or updated; or to get some input on what I might have done wrong.

Problem #1: After updating PIO to the current version, in any operation related to installing a platform (specifically, AtmelAVR 5.0.0, Espressif32) or compiling, PIO started to throw the following warning, which wasn’t there before:

/Users/michael/.platformio/penv/lib/python3.8/site-packages/urllib3/init.py:34: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the ‘ssl’ module is compiled with ‘LibreSSL 2.8.3’. See: urllib3>=2.0 does not work with system Python on macOS · Issue #3020 · urllib3/urllib3 · GitHub

Problem #2: when changing build flags my platformio.ini, PIO processed the file literally after every letter, and the editor window lost focus; just about making changes impossible.

Apparently, PIO was using a Python 3.8 that is part of the macOS Command Line Tools. And that caused Problem #1. I have no idea where Problem #2 came from.

In order to fix this:

  1. quit VSCode
  2. uninstall CLT
  3. launch VSCode, uninstall PIO extension and quit VSCode
  4. delete .platformio folder in my home directory
  5. launch VSCode and reinstall PIO
  6. PIO complains about not finding Python and gives some options
  7. selecting Python3 from the Anaconda install did not work
  8. finally, I select the “portable Python 3” option
  9. finally, re-install CLT so that GIT etc. works

Development system:
Intel-based iMac Pro
Mac OS Sonoma: 14.2.1 (Xcode/CLT updated when prompted)
VSCode: 1.85.1
Platformio IDE: v3.3.2
Platform: Atmel AVR 5.0.0

Please remove /Users/michael/.platformio/penv and /Users/michael/.platformio/python3 folders. Restart VSCode. Everything would work.