Python-binance: Error (ImportError: No module named '_strptime') when running program packaged by pyinstaller or cx-Freeze

Created on 22 Mar 2018  路  6Comments  路  Source: sammchardy/python-binance

Traceback (most recent call last):
File "C:\Python36-32\lib\site-packages\cx_Freezeinitscripts__startup__.py", line 14, in run
module.run()
File "C:\Python36-32\lib\site-packages\cx_Freezeinitscripts\Console.py", line 26, in run
exec(code, m.__dict__)
File "main.py", line 2, in
File "C:\binance\mainWindow.py", line 7, in
from worker import Worker
File "C:\binance\worker.py", line 6, in
from binance.client import Client, BinanceAPIException
File "C:\Python36-32\lib\site-packages\binance\client.py", line 8, in
from .helpers import date_to_milliseconds, interval_to_milliseconds
File "C:\Python36-32\lib\site-packages\binance\helpers.py", line 3, in
import dateparser
File "C:\Python36-32\lib\site-packages\dateparser__init__.py", line 4, in
from .date import DateDataParser
File "C:\Python36-32\lib\site-packages\dateparser\date.py", line 13, in
from dateparser.date_parser import date_parser
File "C:\Python36-32\lib\site-packages\dateparser\date_parser.py", line 11, in
from .parser import parse
File "C:\Python36-32\lib\site-packages\dateparser\parser.py", line 10, in
from dateparser.utils.strptime import strptime
File "C:\Python36-32\lib\site-packages\dateparser\utils\strptime.py", line 55, in
__strptime = patch_strptime()
File "C:\Python36-32\lib\site-packages\dateparser\utils\strptime.py", line 26, in patch_strptime
'strptime_patched', *imp.find_module('_strptime')
File "C:\Python36-32\lib\imp.py", line 297, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_strptime'

Most helpful comment

Hi, coud you fix this?

All 6 comments

Hi, coud you fix this?

Is there a workaround or patch to fix it?
I have the same problem. Windows, python3.6, python-binance 0.6.8

I am also building a little app with python-binance and this seems to fix _strptime error, but throws others missing dependencies.

build_exe_options = {
    "include_files":["<your_path_to_python>/Python36/Lib/_strptime.py"]
}

I also have this issue when running pyinstaller

its working for me with cx_freeze and this setup.py

import sys
import zope, google
from cx_Freeze import setup, Executable

# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {
    "include_files":["<your_path_to_python>/Python36/Lib/_strptime.py",
                     "<your_path_to_certificate>/cert.json"],
    "namespace_packages": ["zope.interface", "google"],
    "packages": ["os", "idna", "_cffi_backend"],
    "excludes": ["tkinter"]}
setup(  name = "binance",
        version = "0.1",
        description = "binance",
        options = {"build_exe": build_exe_options},
        executables = [Executable("<your_main_file>.py")])
Was this page helpful?
0 / 5 - 0 ratings

Related issues

rightx2 picture rightx2  路  4Comments

delware1 picture delware1  路  4Comments

iamveritas picture iamveritas  路  3Comments

marzwu picture marzwu  路  4Comments

ayy1337 picture ayy1337  路  6Comments