py2exe doesn't import the os module?

大兔子大兔子 提交于 2019-12-23 03:29:07

问题


So, basically, I'm trying to make my Python 2.7 script into an EXE. Here is my setup.py:

from distutils.core import setup
import py2exe
import os

setup(
     options = {
          "py2exe":{
              "includes": ["os"]
              }
          },  
  name = "Anansi CalcPad",
  version = "0.35",
  description = "Anansi CalcPad is a three-tiered application that provides a journal, calculator, and news aggregator in one.",
  author = "Cody Dostal",
  author_email = "cody@seafiresoftware.org",
  url = "http://seafiresoftware.org/wordpress/anansi-calcpad/",
  windows = ["AnansiCalc.py"],
  )

If there is indentation problems, it was caused by a bad copy on StackOverflow's part, not in the code.

Here is the error:

Traceback (most recent call last):
  File "AnansiCalc.py", line 3, in <module>
ImportError: No module named os

What is wrong?

来源:https://stackoverflow.com/questions/9858189/py2exe-doesnt-import-the-os-module

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!