使Python2.7Tkinter gui成为可执行文件

使Python2.7Tkinter gui成为可执行文件,python,pandas,tkinter,py2exe,cx-freeze,Python,Pandas,Tkinter,Py2exe,Cx Freeze,我正在尝试从Tkinter gui.py创建一个可执行文件 我搜索了解决方案,找到了py2exe和cx_freeze 他们都给了我同样的错误,那就是: --------------------------- cx_Freeze: Python error in main script --------------------------- Traceback (most recent call last): File "C:\Python27\lib\site-packages\cx_Freez

我正在尝试从Tkinter gui.py创建一个可执行文件

我搜索了解决方案,找到了py2exe和cx_freeze

他们都给了我同样的错误,那就是:

---------------------------
cx_Freeze: Python error in main script
---------------------------
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27, in <module>
exec(code, m.__dict__)
File "C:\Users\omris\PycharmProjects\tools\ctrlC_gui.py", line 12, in <module>
import excel_zeros_mail as ezm
File "C:\Users\omris\PycharmProjects\tools\excel_zeros_mail.py", line 3, in <module>
import pandas as pd
  File "C:\Python27\lib\site-packages\pandas\__init__.py", line 53, in <module>
    from pandas.io.api import *
  File "C:\Python27\lib\site-packages\pandas\io\api.py", line 15, in <module>
    from pandas.io.gbq import read_gbq
  File "C:\Python27\lib\site-packages\pandas\io\gbq.py", line 44, in <module>
    _GOOGLE_API_CLIENT_VERSION = pkg_resources.get_distribution('google-api-python-client').version
  File "C:\Python27\lib\site-packages\pkg_resources.py", line 332, in get_distribution
    dist = get_provider(dist)
  File "C:\Python27\lib\site-packages\pkg_resources.py", line 212, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "C:\Python27\lib\site-packages\pkg_resources.py", line 741, in require
    needed = self.resolve(parse_requirements(requirements))
  File "C:\Python27\lib\site-packages\pkg_resources.py", line 626, in resolve
    raise DistributionNotFound(req)
DistributionNotFound: google-api-python-client

---------------------------
OK   
---------------------------
我在一个非常简单的tkinter gui上测试了它,效果很好

我猜它和熊猫进口有关

这是我在tkinter gui中的导入:

   import threading
   from Tkinter import *
   import tkMessageBox
   from ttk import *
   import pyperclip
   import time
   from tkFileDialog import *
   import pandas as pd
我访问了位于pkg_resources.py的代码,该代码解决了问题:

if dist is None:
       #msg = ("The '%s' distribution was not found on this "
       #       "system, and is required by this application.")
       #raise DistributionNotFound(msg % req)
       # unfortunately, zc.buildout uses a str(err)
       # to get the name of the distribution here..
       raise DistributionNotFound(req)
我不知道是什么问题

我的google api python客户端版本是1.3.1


我的pandas版本是0.15.2

在我评论了所有pandas行之后,它运行了。。使用pandas库时生成exe有问题吗?
if dist is None:
       #msg = ("The '%s' distribution was not found on this "
       #       "system, and is required by this application.")
       #raise DistributionNotFound(msg % req)
       # unfortunately, zc.buildout uses a str(err)
       # to get the name of the distribution here..
       raise DistributionNotFound(req)