简体   繁体   English

将.py文件构建为.exe时导入错误

[英]Import error when building .py file to .exe

I am using python 2.7.10, and have scripted a program which plays music with the help of mp3play module. 我正在使用python 2.7.10,并编写了一个程序,该程序借助mp3play模块播放音乐。 I have installed the mp3play module and the program is working fine in .py format but when I am trying to build it into .exe with the help of py2exe, It is giving me ImportError: Stating mp3play module is not installed. 我已经安装了mp3play模块,并且该程序以.py格式正常工作,但是当我尝试借助py2exe将其构建为.exe时,它给了我ImportError:未安装mp3play模块。 Here is the following code for the setup.py file for the building of exe 这是用于构建exe的setup.py文件的以下代码

import os
import sys
from distutils.core import setup
import py2exe

py2exe.build_exe._py_suffixes = ['.py', '.pyo', '.pyc', '.pyw', '.dat', '.log', '.txt', '.png']




setup(
   version = "1.0",            
   name = "abcd",
   author = "pqrs,mnop",
   author_email = "abcd@gmail.com,pqrs@gmail.com",
   windows=[{'script': "main.py","icon_resources": [(0, "data/icon.ico")]}] , options={'py2exe':{"skip_archive": True,"unbuffered": True,'packages':['Tkinter','PIL','mp3play','tkFileDialog','tkMessageBox','ttk','os', 'sys']}}
 )

can someone help me out and tell me where I am getting it wrong ?? 有人可以帮我一下,告诉我哪里错了吗?

可以从此处http://mp3play.googlecode.com引用使用mp3play的一种非常优雅的方法

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

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