草庐IT

script_name

全部标签

python - 导入错误 : cannot import name cbook

>>>importmatplotlibTraceback(mostrecentcalllast):File"",line1,inFile"/usr/local/lib/python2.7/dist-packages/matplotlib/__init__.py",line123,infrom.importcbookImportError:cannotimportnamecbook我没有找到解决方案,有人可以帮忙吗? 最佳答案 1.尝试更新matplotlibpython-mpipinstall-Umatplotlib2.尝试重新安装

python - ImportError : No module named mpl_toolkits with maptlotlib 1. 3.0 和 py2exe

我现在不知道如何通过py2exe打包它:我正在运行命令:pythonsetup2.pypy2exe通过python2.7.5和matplotlib1.3.0以及py2exe0.6.9和0.6.10dev这适用于matplotlib1.2.x我已阅读http://www.py2exe.org/index.cgi/ExeWithEggs并尝试实现处理mpl_toolkits的建议,因为它已成为命名空间包。我也想在这里得到答案:http://matplotlib.1069221.n5.nabble.com/1-3-0-and-py2exe-regression-td41723.html向mp

python - ImportError : No module named mpl_toolkits with maptlotlib 1. 3.0 和 py2exe

我现在不知道如何通过py2exe打包它:我正在运行命令:pythonsetup2.pypy2exe通过python2.7.5和matplotlib1.3.0以及py2exe0.6.9和0.6.10dev这适用于matplotlib1.2.x我已阅读http://www.py2exe.org/index.cgi/ExeWithEggs并尝试实现处理mpl_toolkits的建议,因为它已成为命名空间包。我也想在这里得到答案:http://matplotlib.1069221.n5.nabble.com/1-3-0-and-py2exe-regression-td41723.html向mp

python - 从 。导入_方法 ImportError : cannot import name '_methods' in cx-freeze python

exe使用cx-freeze成功构建。但是当我执行exe文件时它显示以下错误:from.import_methodsImportError:cannotimportname'_methods' 最佳答案 这个问题已经在这里回答:WhyamIgettingthisImportError?但为了完整起见,这里是针对这种特定情况的答案:cx_freeze未导入可选模块_method,因此您必须明确告诉他这样做。additional_mods=['numpy.core._methods','numpy.lib.format']setup(n

python - 从 。导入_方法 ImportError : cannot import name '_methods' in cx-freeze python

exe使用cx-freeze成功构建。但是当我执行exe文件时它显示以下错误:from.import_methodsImportError:cannotimportname'_methods' 最佳答案 这个问题已经在这里回答:WhyamIgettingthisImportError?但为了完整起见,这里是针对这种特定情况的答案:cx_freeze未导入可选模块_method,因此您必须明确告诉他这样做。additional_mods=['numpy.core._methods','numpy.lib.format']setup(n

python - 导入错误 : cannot import name '_ccallback_c'

最初我遇到这个错误(没有找到模块名称scipy)所以我安装了一个Scipywheel文件。现在我不再遇到同样的错误,但我得到了cannotimportname"_ccallback_c"。错误似乎是在第四行代码处触发的。我做了我的研究,看到其他人建议尝试像Anaconda这样的环境。我已经看到它在闲置时工作,并且该解决方案对我来说并不理想。回溯:Traceback(mostrecentcalllast):File"C:\Users\joesh\Desktop\Python\MachineLearning\1sttutorial.py",line4,infromsklearnimport

python - 导入错误 : cannot import name '_ccallback_c'

最初我遇到这个错误(没有找到模块名称scipy)所以我安装了一个Scipywheel文件。现在我不再遇到同样的错误,但我得到了cannotimportname"_ccallback_c"。错误似乎是在第四行代码处触发的。我做了我的研究,看到其他人建议尝试像Anaconda这样的环境。我已经看到它在闲置时工作,并且该解决方案对我来说并不理想。回溯:Traceback(mostrecentcalllast):File"C:\Users\joesh\Desktop\Python\MachineLearning\1sttutorial.py",line4,infromsklearnimport

python - 命名数据类型数组 : Difference between a[0] ['name' ] and a ['name' ][0]?

我在numpy中遇到了以下奇怪的事情,这可能是也可能不是错误:importnumpyasnpdt=np.dtype([('tuple',(int,2))])a=np.zeros(3,dt)type(a['tuple'][0])#ndarraytype(a[0]['tuple'])#ndarraya['tuple'][0]=(1,2)#oka[0]['tuple']=(1,2)#ValueError:shape-mismatchonarrayconstruction我原以为下面的两个选项都有效。意见? 最佳答案 我在numpy讨论列表

python - 命名数据类型数组 : Difference between a[0] ['name' ] and a ['name' ][0]?

我在numpy中遇到了以下奇怪的事情,这可能是也可能不是错误:importnumpyasnpdt=np.dtype([('tuple',(int,2))])a=np.zeros(3,dt)type(a['tuple'][0])#ndarraytype(a[0]['tuple'])#ndarraya['tuple'][0]=(1,2)#oka[0]['tuple']=(1,2)#ValueError:shape-mismatchonarrayconstruction我原以为下面的两个选项都有效。意见? 最佳答案 我在numpy讨论列表

python - 如何使用 setuptools 生成调用 `python -m mypackage` 的 console_scripts 入口点?

我正在努力成为一名优秀的Pythonista并关注PEP338对于我计划部署的包。我还尝试使用setuptoolsentry_points{'console_scripts':...}选项在pythonsetuptoolsinstall上生成我的可执行脚本。如何使用entry_points生成调用python-mmypackage(并传递*args、**kwargs)的二进制文件?以下是我做过的一些尝试,但都没有成功:setuptools(...(1)entry_points={'console_scripts':['mypkg=mypkg.__main__'],},(2)entry_