草庐IT

SITE_NAME

全部标签

python - 意外异常 : name 'basestring' is not defined when invoking ansible2

我正在尝试执行ansible2commnads...当我这样做时:ansible-playbook-vvv-imy/inventorymy/playbook.yml我明白了:UnexpectedException:name'basestring'isnotdefinedthefulltracebackwas:Traceback(mostrecentcalllast):File"/usr/local/bin/ansible-playbook",line85,insys.exit(cli.run())File"/usr/local/lib/python3.4/site-packages/a

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

我已经开始学习TensorFlow。我正在使用Pycharm,我的环境是Ubuntu16.04。我正在关注tutorial.我交叉检查了num。它是最新的。我不知道这个错误的原因。fromnumpy.lib.arraypadimport_validate_lengthsImportError:cannotimportname'_validate_lengths'需要提示来解决此错误。谢谢。importtensorflowastffromskimageimporttransformfromskimageimportdataimportmatplotlib.pyplotaspltimpor

python - 无法从 site-packages 目录加载通过 pip 安装的 Python 模块

我正在尝试安装和使用Evernote模块(https://github.com/evernote/evernote-sdk-python)。我运行了pipinstallevernote,它说安装成功了。我可以确认evernote模块存在于/usr/local/lib/python2.7/site-packages中。但是,当我尝试运行python-c"importevernote"时,出现以下错误:Traceback(mostrecentcalllast):File"",line1,inImportError:Nomodulenamedevernote这是我的.bash-profile

python - 名称错误 : global name 'execfile' is not defined trying to run an app on Google App Engine Launcher

我在Windows中收到此错误,我有3.2和2.7版本的python。我该如何解决这个问题? 最佳答案 您只需要转到编辑/首选项并指定正确版本的python路径 关于python-名称错误:globalname'execfile'isnotdefinedtryingtorunanapponGoogleAppEngineLauncher,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions

python - 为什么 pip freeze 会报告使用 --no-site-packages 创建的新 virtualenv 中的一些包?

当我创建一个新的virtualenv时,pipfreeze显示我安装了几个包,即使我没有在环境中安装任何东西。我期待pipfreeze在我第一次pipinstall进入环境之前返回空输出。wsgirefispartofthestandardlibrary不是吗,为什么它会出现呢?day@garage:~$mkdirtestingday@garage:~$cdtestingday@garage:~/testing$virtualenv--no-site-packages.Newpythonexecutablein./bin/pythonInstallingdistribute......

python - 名称错误 : name 'reload' is not defined

我正在使用python3.2.2。当我写一个简单的程序时,我遇到了这个问题。>>>reload(recommendations)Traceback(mostrecentcalllast):File"",line1,inreload(recommendations)NameError:name'reload'isnotdefined我该怎么做? 最佳答案 您可能想要importlib.reload().fromimportlibimportreload在Python2.x中,这是一个builtin,但在3.x中,它位于importli

Python名称错误: name 'include' is not defined

已结束。此问题需要debuggingdetails.它目前不接受答案。编辑问题以包含desiredbehavior,aspecificproblemorerror,andtheshortestcodenecessarytoreproducetheproblem.这将有助于其他人回答问题。关闭6年前。Improvethisquestion我目前正在使用框架Django开发一个网站(我是初学者),但是我在使用Python时遇到了问题:因为我已经创建了我的模板,因此我不能再运行服务器了(堆栈跟踪指向文件urls.py中的一行):...path('apppath/',include('myap

python - 在 include() 中使用命名空间时有关 app_name 的错误配置错误

我目前正在试用Django。我在urls.py中的一个include()中使用了namespace参数。当我运行服务器并尝试浏览时,我收到此错误。File"C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\conf.py",line39,ininclude'Specifyinganamespaceininclude()withoutprovidinganapp_name'django.core.exceptions.ImproperlyConfigured:Spec

python - OS X ("ImportError: cannot import name _thread"上的 Matplotlib 问题)

在过去几天的某个时候,Matplotlib在OSX上停止为我工作。这是我在尝试importmatplotlib时遇到的错误:Traceback(mostrecentcalllast):File"/my/path/to/script/my_script.py",line15,inimportmatplotlib.pyplotaspltFile"/Library/Python/2.7/site-packages/matplotlib/pyplot.py",line34,infrommatplotlib.figureimportFigure,figaspectFile"/Library/Py

python - 导入错误 : cannot import name NUMPY_MKL

我正在尝试运行以下简单代码importscipyscipy.test()但我收到以下错误Traceback(mostrecentcalllast):File"",line1,inFile"C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py",line586,inrunfileexecfile(filename,namespace)File"C:/Users/Mustafa/Documents/MyPythonCode/SpectralGraphAnalysis/main.py",l