Python:MemoryError
在用Python处理大数据时,本来16G的内存,内存还没使用四分之一就开始报MemoryError的错误,后来才知道32bit的Python使用内存超过2G之后,就报这个错误,还没有其他的提示消息。
果断换64bit的Python。
一开始安装32bit的Python,是因为numpy和scipy官方版本只支持32bit的,后来又找到了非官方的版本http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpywheel文件安装时出现:Fatal error in launcher: Unable to create process using '“”C:\Program Files (x86)\Python33\python.exe“” “C:\Program Files (x86)\Python33\pip.exe”在http://stackoverflow.com/questions/24627525/fatal-error-in-launcher-unable-to-create-process-using-c-program-files-x86上找到解决方法:python -m pip install XXX
python 问题,第一次运行程序Hello Word 报错
没问题,可能是字符缩进格式问题吧,仔细检查一下:class MyClass(object):def __init(self):passi=12345def f(self):return "hello word"def main():passif __name__=='__main__' :print(MyClass().f())
python WindowsError: [Error 5]如何解决
首先,黏贴代码的时候注意缩进,否则我们想在机上修改的时候好麻烦(⊙﹏⊙)第二,学习Python代码要会倒着看,从try的部分看起。
另我觉得不是很有必要print所有的变量,重点在整个程序的理解。
第三,这道题目想利用txt文件中的单词来替换PHARSES中的%%%,***,@@@,PHARASES是一个dict类,分为keys and values.在程序中分别命名为snippet还有phrase:Python Codetry:while True:snippets = PHRASES.keys()#选择keyprint "snippet " , snippetsrandom.shuffle (snippets)#打乱顺序print "random.s",random.shuffle(snippets)#上面这一个步骤是从五个PHRASES elements随机选择一个for snippet in snippets:print "73line-snippet",snippetphrase = PHRASES[snippet]#提取key值相应的valueprint "75line-phrase", phraseprint "76line-snippet", snippetprint "77line-%convert(snippet, phrase)", convert(snippet, phrase)question, answer = convert(snippet, phrase) #代入单词print "answer", answerif PHRASE_FIRST:question, answer = answer, question print question#传递参数raw_input("> ")print "ANSWER: %s\n\n" % answerexcept EOFError:print "\nBYE"#异常情况处理第四,def convert()中你写的没错,问题似乎没有出现在那里。
就酱
Python代码错误请大神指教!!!感谢!!
展开全部之前为了测试一个tensorflow的python代码,安装了64位的python,和电脑上32bit的冲突了,一开始没发现,需要安装wordcloud模块的时候才发现使用pip安装,就会报错error[2],xxx找不到只能卸载64bit,重新安装32bit重新安装之后,别的模块可以安装,但是wordcloud仍然不能安装删除cache也没用,最后下载了wheel安装文件,安装成功!
转载请注明出处51数据库 » python word 报错