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

Getting 'ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+' when configuring or building a project #4639

Closed
BasTossings opened this issue May 25, 2023 · 1 comment
Assignees
Labels

Comments

@BasTossings
Copy link

BasTossings commented May 25, 2023

What kind of issue is this?

  • [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: MacOS Ventura 13.4 (22F66) on Intel

PlatformIO Version (platformio --version): 6.1.7

Description of problem

Every time I (re)open or build my project in VSCode, or when I use the pio run command from the terminal, I get the following platformIO error:

CMake Error at /Users/redacted/.platformio/packages/framework-espidf/tools/cmake/build.cmake:519 (message):
  Traceback (most recent call last):

    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
      "__main__", mod_spec)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
      exec(code, run_globals)
    File "/Users/redacted/.platformio/penv/.espidf-5.0.2/lib/python3.7/site-packages/idf_component_manager/prepare_components/__main__.py", line 4, in <module>
      from .prepare import main
    File "/Users/redacted/.platformio/penv/.espidf-5.0.2/lib/python3.7/site-packages/idf_component_manager/prepare_components/prepare.py", line 18, in <module>
      from ..core import ComponentManager
    File "/Users/redacted/.platformio/penv/.espidf-5.0.2/lib/python3.7/site-packages/idf_component_manager/core.py", line 17, in <module>
      import requests
    File "/Users/redacted/.platformio/penv/.espidf-5.0.2/lib/python3.7/site-packages/requests/__init__.py", line 43, in <module>
      import urllib3
    File "/Users/redacted/.platformio/penv/.espidf-5.0.2/lib/python3.7/site-packages/urllib3/__init__.py", line 39, in <module>
      "urllib3 v2.0 only supports OpenSSL 1.1.1+, currently "

  ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl'
  module is compiled with OpenSSL 1.1.0h 27 Mar 2018.  See:
  https://github.com/urllib3/urllib3/issues/2168

Call Stack (most recent call first):
  /Users/redacted/.platformio/packages/framework-espidf/tools/cmake/project.cmake:447 (idf_build_process)
  CMakeLists.txt:3 (project)

I get this error even when I create blank new project (EPS32 with ESP-IDF).

Steps to Reproduce

  1. Create new project from within VSCode

Actual Results

Error occurs on the 'PlatformIO: Configuring project' or 'build' step

Expected Results

No errors

If problems with PlatformIO Build System:

The content of platformio.ini:

[env:lolin_d32]
platform = espressif32
board = lolin_d32
framework = espidf

Additional info

I tried reinstalling PlatformIO, both from within VSCode or using the bleeding edge installer script.

I tried deleting the ~/.platformio directory and then reinstalling.

I tried manually installing the latest OpenSSL.

openssl version -a returns:

OpenSSL 3.1.0 14 Mar 2023 (Library: OpenSSL 3.1.0 14 Mar 2023)
built on: Tue Mar 14 12:59:07 2023 UTC
platform: darwin64-x86_64-cc
options:  bn(64,64)
compiler: clang -fPIC -arch x86_64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -D_REENTRANT -DOPENSSL_BUILDING_OPENSSL -DNDEBUG
OPENSSLDIR: "/usr/local/etc/openssl@3"
ENGINESDIR: "/usr/local/Cellar/openssl@3/3.1.0/lib/engines-3"
MODULESDIR: "/usr/local/Cellar/openssl@3/3.1.0/lib/ossl-modules"
Seeding source: os-specific
CPUINFO: OPENSSL_ia32cap=0x7ffaf3ffffebffff:0x40000000029c67af

But none of that seems to help

Also, I tried the workaround for issue 4614 but no luck.

@BasTossings
Copy link
Author

Okay I installed the latest version of python (3.11) and deleted my older versions (3.7 and 3.8) and reinstalled platformIO after deleting ~/.platformio and that seems to have fixed it. Maybe platformIO could warn users if their python version is out of date?

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

3 participants