I have a script, which uses gspread for manupilating with Google Drive data. And I want to create a simple executable in Windows. But yet no luck.
Note
- Python 3.4
- Windows XP
What I've tried so far:
- PyInstaller 3.0
- py2exe 0.9.9.2
- cx_Freeze
PyInstaller
Goes to the step 60020 INFO: Looking for ctypes DLLs and then
blah-blah-blah...
File "C:\Python34\lib\ntpath.py", line 246, in basename return split(p)[1] File "C:\Python34\lib\ntpath.py", line 217, in split d, p = splitdrive(p) File "C:\Python34\lib\ntpath.py", line 161, in splitdrive normp = p.replace(_get_altsep(p), sep) AttributeError: 'tuple' object has no attribute 'replace'
- py2exe
Setup.py (configuration took here)
from distutils.core import setup
import py2exe, sys, os
sys.setrecursionlimit(5000)
sys.argv.append('py2exe')
setup(
options = {'py2exe': {'bundle_files': 1, 'compressed': True}},
windows = [{'script': "main.py"}],
zipfile = None,
)
Before I added
sys.setrecursionlimit(5000)
I was gettingRuntimeError: Maximum recursion depth exceeded.
Added
sys.setrecursionlimit(5000)
andRuntimeError: maximum recursion depth exceeded in comparison
Error is with mf3 file as here, so I added "excludes":["six.moves.urllib.parse"]
but error is the same.
- Cx_Freeze
This was the closest to success. Even created exe. But there's a problem with cacert with getting
[Errno 2] No such file or directory
I've tried all methods from here and here here, copied cacerts.txt, cacert.pem but still[Errno 2] No such file or directory
Here is a code of setup.py:
import sys
from cx_Freeze import setup, Executable
import requests.certs
includefiles = ['key.json', (requests.certs.where(),'cacert.pem')]
includes = []
excludes = []
icon = None
base = None
if (sys.platform == "win32"):
base = "Win32GUI"
setup(
name = 'Scraper',
version = '1.0',
author = 'GriMel',
author_email = 'GriefMontana@gmail.com',
options = {'build_exe': {'excludes':excludes,
'include_files':includefiles,
'icon' : icon}},
executables = [Executable('main.py')],
)
Looking forward to you help.