1

I made a program in Python 3 to make a board of a Bot to Crypto currency. The program works fine without error but with cx_Freeze I have an error on a query with coinmarketcap with the error that the SSL module is missing.

import sys
from cx_Freeze import setup, Executable
import os
import requests.certs

packages = ["tkinter", "requests", "idna", "queue", "coinmarketcap", "requests_cache", "PIL", "urllib3", "OpenSSL", "ssl", "arrow", "tempfile", "json", "locale", "C:\\Users\\cavaud\\Desktop\\botTKinker\\config", "time", "sys", "MySQLdb", "urllib.request"] 
includeFile = [requests.certs.where(), "cacert.pem", "ico24x24.ico" , "bas.png", "haut.png", "egal.png", "level.png", "logoBotV2H2.png", "orderNOK.gif", "orderOK.gif", "C:\\Users\\cavaud\\AppData\\Local\\Programs\\Python\\Python37-32\\DLLs\\tcl86t.dll", "C:\\Users\\cavaud\\AppData\\Local\\Programs\\Python\\Python37-32\\DLLs\\tk86t.dll"]


path = sys.path
os.environ['TCL_LIBRARY'] = "C:\\Users\\cavaud\\AppData\\Local\\Programs\\Python\\Python37-32\\tcl\\tcl8.6"
os.environ['TK_LIBRARY'] = "C:\\Users\\cavaud\\AppData\\Local\\Programs\\Python\\Python37-32\\tcl\\tk8.6"
os.environ['REQUESTS_CA_BUNDLE'] = "cacert.pem"
base = None
if sys.platform == "win32":
    base = "Win32GUI"

options = {  "path": path,
        "includes": includeModule,
        "include_files": includeFile,
        "packages" : packages,
        "silent": False
       }

options["include_msvcr"] = True        

cible_1 = Executable(
    script="botTK.py",
    base=base,
    icon="ico24x24.ico"
    )

setup(
    name="BotTK",
    version="1.00",
    description="BOT TK",
    author="moi",
    options={"build_exe": options},
    executables=[cible_1]
    )

Thank you

jpeg
  • 2,372
  • 4
  • 18
  • 31

1 Answers1

0

Try to modify your setup.py script as follows:

includeFile = [(requests.certs.where(), "cacert.pem"), "ico24x24.ico" , "bas.png", "haut.png", "egal.png", "level.png", "logoBotV2H2.png", "orderNOK.gif", "orderOK.gif", "C:\\Users\\cavaud\\AppData\\Local\\Programs\\Python\\Python37-32\\DLLs\\tcl86t.dll", "C:\\Users\\cavaud\\AppData\\Local\\Programs\\Python\\Python37-32\\DLLs\\tk86t.dll"]

(please note the parentheses around the first two entries!), and

os.environ['REQUESTS_CA_BUNDLE'] = os.path.join(os.getcwd(), "cacert.pem")

See Requests library: missing SSL handshake certificates file after cx_Freeze

jpeg
  • 2,372
  • 4
  • 18
  • 31
  • 1
    @MichelBlogdeMichel Have you tried this answer? Please provide feedback to people investing time trying to help you. This is the least they would deserve, especially in view of the fact that you have opened an issue both here and on the [cx_Freeze repository](https://github.com/anthony-tuininga/cx_Freeze/issues/428) and tried to get more attention using meaningless "UP" comments at both places. – jpeg Nov 02 '18 at 09:33