Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

platformio fails to run on macOS Ventura due to urllib3 #4614

Closed
famousmoose opened this issue May 6, 2023 · 5 comments
Closed

platformio fails to run on macOS Ventura due to urllib3 #4614

famousmoose opened this issue May 6, 2023 · 5 comments
Labels
Milestone

Comments

@famousmoose
Copy link

  • [ X] PlatformIO Core.
    If you’ve found a bug, please provide an information below.

You can erase any parts of this template not applicable to your Issue.


Configuration

Operating system: Mac OS Ventura 13.3.1 (a) ARM64

PlatformIO Version (platformio --version): PlatformIO Core, version 6.1.6

Description of problem

A default install of platformio on a MacOS host using the default python and python ssl module will fail to run, giving the following error

$ platformio --version
Traceback (most recent call last):
  File "/Users/stu/.platformio/penv/bin/platformio", line 5, in <module>
    from platformio.__main__ import main
  File "/Users/stu/.platformio/penv/lib/python3.9/site-packages/platformio/__main__.py", line 21, in <module>
    from platformio import __version__, exception, maintenance
  File "/Users/stu/.platformio/penv/lib/python3.9/site-packages/platformio/maintenance.py", line 22, in <module>
    from platformio import __version__, app, exception, fs, telemetry
  File "/Users/stu/.platformio/penv/lib/python3.9/site-packages/platformio/telemetry.py", line 28, in <module>
    import requests
  File "/Users/stu/.platformio/penv/lib/python3.9/site-packages/requests/__init__.py", line 43, in <module>
    import urllib3
  File "/Users/stu/.platformio/penv/lib/python3.9/site-packages/urllib3/__init__.py", line 38, in <module>
    raise ImportError(
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with LibreSSL 2.8.3. See: https://github.com/urllib3/urllib3/issues/2168

This is due to the recently launched urllib3 version 2 series throws errors when used with libressl and older versions of openssl. urllib3 is a dependency for requests

Steps to Reproduce

  1. Install platfromio using platformio installer (e.g. python3 -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
  2. run platformio --version

Actual Results

The error listed above

Expected Results

PlatformIO Core, version 6.1.6

Additional info

A workaround is as follows:

. ~/.platformio/penv/bin/activate
pip install urllib3==1.26.15

This allows the platformio command to work correctly.

@ivankravets ivankravets added this to the 6.1.7 milestone May 6, 2023
@ivankravets ivankravets added the bug label May 6, 2023
@ivankravets
Copy link
Member

Thanks for the report!

@maxgerhardt
Copy link
Contributor

Users are also running into this here, while manual latest version isntall works, maybe a new stable version needs to be pushed.

@ivankravets
Copy link
Member

Thanks for pinging. 6.1.7 is ready! https://github.com/platformio/platformio-core/releases/tag/v6.1.7

🚀

@nstansbury
Copy link

For others coming here, you will now get a warning even with 6.1.11 due to a change in urllib3 allowing support for LibreSSL with a warning. This occurs despite using the PIO installed Python and having [email protected] installed and in my PATH$

/Volumes/DATA/PlatformIO/penv/lib/python3.8/site-packages/urllib3/__init__.py:34: NotOpenSSLWarning: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020 warnings.warn(
PlatformIO Core             6.1.11
Python                      3.8.2-final.0
System Type                 darwin_x86_64
Platform                    macOS-10.15.7
File System Encoding        utf-8
Locale Encoding             UTF-8
PlatformIO Core Directory   /Volumes/DATA/PlatformIO
PlatformIO Core Executable  /Volumes/DATA/PlatformIO/penv/bin/platformio
Python Executable           /Volumes/DATA/PlatformIO/penv/bin/python
Global Libraries            0
Development Platforms       2
Tools & Toolchains          9

"Fixed" by following maxgerhardt suggestion to downgrade urllib3 to 1.26.15

@lemonkey
Copy link

lemonkey commented Nov 23, 2023

Also noticed this started happening for me after I upgraded to macOS Sonoma 14.0.

Also "Fixed" by following maxgerhardt suggestion to downgrade urllib3 to 1.26.15

However, instead of using . ~/.platformio/penv/bin/activate, I had to I first change into ~/.platformio/penv and then run source bin/activate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants