I compile a simple python script 2.7 in exe using py2exe. There are no errors when compiling

requests.exceptions.SSLError: [Errno 2] No such file or directory 

Google knows this error, as I understand it from the discussions, the error is related to the cacert.pem file. Put it next to the exe - no change. Did someone solve this problem? Here is the code that I compile

 # -*- coding: utf-8 -*- from win32com import client import telepot import ConfigParser import codecs import os config = ConfigParser.RawConfigParser() config.readfp(codecs.open('config.ini', 'r', 'cp1251'))#Задаем имя ini-файла path = config.get('main', 'path') chatID = config.get('main', 'chatid') print (path) print (chatID) xlApp = client.Dispatch("Excel.Application") books = xlApp.Workbooks.Open(path) t= books.Worksheets.count # количество листов print(t) ws = books.Worksheets[t-1] n = ws.name # Имя листа print (n) report = 'C:\\test\\'+n+'.pdf' ws.Visible = 1 ws.ExportAsFixedFormat(0, report) books.Close() xlApp.Quit() ####telegram TOKEN = '' bot = telepot.Bot(TOKEN) f = open(report, 'rb') # some file on local disk n2 = "Отчет " n2UTF = unicode(n2, 'utf-8', errors='replace') Text = n2UTF + n message = bot.sendMessage(chatID,Text) response = bot.sendDocument(chatID, f) print(response) print report f.close() os.remove(report) 
  • Removed TOKEN from the code. Don't do that! - approximatenumber
  • Look here for a similar question . - Andrew Hobbit

0