py2exe编译链接python代码报错ImportError,py2exeimporterror,使用py2exe编译链接
py2exe编译链接python代码报错ImportError,py2exeimporterror,使用py2exe编译链接
使用py2exe编译链接python代码的时候,没出现问题,但在运行编译生成后的exe文件是,会报错:ImportError: No module named BeautifulSoup
百度了好久,都没找到答案,希望会的朋友帮忙提醒下,tks~
Python:2.7
BeautifulSoup:3.2
详细代码如下所示:
BeautifulSoupStudy.py
__author__ = 'Flying'# -*- coding: utf-8 -*-from BeautifulSoup import * #HTML、XMLif __name__ =="__main__": doc = [ '
This is paragraph one.', '
This is paragraph two.', '' ] # BeautifulSoup 接受一个字符串参数 soup = BeautifulSoup(''.join(doc)) print soup.prettify()
setup.py
from distutils.core import setup import py2exe import sys includes = ["encodings", "encodings.*"] sys.argv.append("py2exe") options = {"py2exe": { "bundle_files": 1 } } setup(options = options, zipfile=None, console = [{"script":'BeautifulSoupStudy.py'}])
报错如下
Traceback (most recent call last): File "BeautifulSoupStudy.py", line 3, inImportError: No module named BeautifulSoup
BeautifulSoup 是一个模块,你检查一下有没有安装,没有的话 pip install beautifulsoup
编橙之家文章,
相关内容
- 请教python下载网页torrent文件的方法,pythontorrent,http:/
- Python统计网站流量及访客求交流,python访客,统计网站的
- python fabric批量管理多台server执行方法问题,pythonfabri
- 请问有Vim编辑器删除末尾空白字符操作快捷方式吗?,
- android解锁种数代码哪位python大神精通望指点,androidp
- 为什么我的for循环列表中最后一项总会被覆盖的原因是
- 我的python DHT11测温代码运行出错是如何解决,pythondht
- Python getattr报TypeError错误,getattrtypeerror,#-*-coding:u
- Python当前目录有同名模块请问如何导入内置socket模块,
- 请问django csrf文档中下面句话应该如何理解,djangocsrf
评论关闭