Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8692179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:16:07+00:00 2026-06-13T00:16:07+00:00

I’m trying to compile a Python program using PyInstaller. When I try to use

  • 0

I’m trying to compile a Python program using PyInstaller. When I try to use a function that uses ssl, a get an Import Error:

ImportError: No module named certifi

I’ve modified the .spec file in order to include the cacert.pem file from Python ssl library:

# -*- mode: python -*-
a = Analysis(['main.py'],
             pathex=['D:\\Projects\\soundcloud'],
             hiddenimports=[],
             hookspath=None)
a.datas.append(('cacert.pem', 'cacert.pem', 'DATA'))
pyz = PYZ(a.pure)
exe = EXE(pyz,
          a.scripts,
          exclude_binaries=1,
          name=os.path.join('build\\pyi.win32\\main', 'main.exe'),
          debug=False,
          strip=None,
          upx=True,
          console=True )
coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               strip=None,
               upx=True,
               name=os.path.join('dist', 'main'))

But then I get the following error:

Traceback (most recent call last):
File "...\soundcloud\build\pyi.win32\main\out00-PYZ.pyz\api", line 186,
in run_api_thread
File "...\soundcloud\build\pyi.win32\main\out00-PYZ.pyz\api", line 40, 
in authenticate
File "...\soundcloud\build\pyi.win32\main\out00-PYZ.pyz\soundcloud.client", 
line 60,
in exchange_token
File "...\soundcloud\build\pyi.win32\main\out00-PYZ.pyz\soundcloud.request", 
line 173, in make_request
File "...\soundcloud\build\pyi.win32\main\out00-PYZ.pyz\requests.api", 
line 84, in post
File "...\soundcloud\build\pyi.win32\main\out00-PYZ.pyz\requests.api", 
line 39, in request
File "D:\Projects\soundcloud\build\pyi.win32\main\out00-PYZ.pyz\requests.sessions"
line 200, in request
File "D:\Projects\soundcloud\build\pyi.win32\main\out00-PYZ.pyz\requests.models",
line 537, in send
SSLError: [Errno 185090050] _ssl.c:336: 
error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib

What is the right way to include the certificate in to make ssl work when compiled with PyInstaller?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:16:09+00:00Added an answer on June 13, 2026 at 12:16 am

    The problem was solved with by changing the environment variable:

    os.environ['REQUESTS_CA_BUNDLE'] = os.path.join(os.getcwd(), 'cacert.pem')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.