简体   繁体   English

使用python py2exe转换为Windows exe控制台

[英]using python py2exe to convert to windows exe console

i am new to python, i found py2exe and used it on a small test python code and it worked fine. 我是python的新手,我找到py2exe并在一个小的测试python代码上使用了它,并且工作正常。 i have now created a program that uses openpyxl library for excel spreadsheets. 我现在创建了一个将openpyxl库用于excel电子表格的程序。 when i compile to .exe using py2exe i get no errors, however when i try and execute the new .exe i get the following in a log file and on console for my new .exe 当我使用py2exe编译为.exe时,我没有收到错误,但是,当我尝试执行新的.exe时,我在日志文件中和控制台上得到了新的.exe的以下信息:

Traceback (most recent call last):
  File "pdf_to_excel.py", line 2, in <module>
  File "openpyxl\__init__.pyo", line 29, in <module>
  File "openpyxl\workbook\__init__.pyo", line 5, in <module>
  File "openpyxl\workbook\workbook.pyo", line 16, in <module>
  File "openpyxl\writer\write_only.pyo", line 23, in <module>
  File "openpyxl\writer\excel.pyo", line 36, in <module>
  File "openpyxl\packaging\extended.pyo", line 4, in <module>
ImportError: cannot import name __version__

i checked c:\\python27\\lib\\site-packages it contains "openpyxl" and "openpyxl-2.4.4-py2.7.egg" 我检查了c:\\ python27 \\ lib \\ site-packages,其中包含“ openpyxl”和“ openpyxl-2.4.4-py2.7.egg”

i am not sure why i am getting the backtrace or how to fix this? 我不确定为什么要得到回溯或如何解决?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM