草庐IT

legacy_module

全部标签

python - Django - 导入错误 : No module named *. url

我正在处理officialDjangotutorial并使用Django版本1.6.1、Python2.7.6稍微调整它以满足我自己的需要。我正处于映射URL的地步,但是当非常明显的模块中有一个恰当命名的文件时,我不断收到“没有名为customers.urls的模块”错误,所以我真的很茫然至于我做错了什么。我最初的想法是,我需要在root/urls.py中导入一些与客户相关的内容,但每种导入组合都会导致大致相同的错误,而且教程没有说明要这样做。ROOT_URLCONF='taco.urls'(taco是项目名)我正在使用manage.py/runserver运行它,所以没有我所知道的特

python - 谷歌 API Python - KeyError : _module

我正在尝试使用quickstart.py(https://developers.google.com/gmail/api/quickstart/python)按照谷歌的GmailAPI使用oauth2。我收到以下错误。Traceback(mostrecentcalllast):File"quickstart.py",line68,inmain()File"quickstart.py",line54,inmaincredentials=get_credentials()File"quickstart.py",line37,inget_credentialscredentials=stor

python - 导入错误 : No module named 'keras_contrib'

我正在尝试使用下面的导入命令导入Keraslib代码以执行CRF,但如标题所示出现错误。请分享解决方案。用来执行的命令是fromkeras_contrib.layersimportCRFTraceback(mostrecentcalllast):File"",line1,infromkeras_contrib.layersimportCRFImportError:Nomodulenamed'keras_contrib' 最佳答案 一个简单的(sudo)pipinstallgit+https://www.github.com/kera

python - Django "No Module Named URLs"错误

已经有很多类似的问题发布了,但我已经尝试过这些解决方案,但都无济于事。我正在完成基本的Django教程,这是我的代码:网址.pyfromdjango.conf.urlsimportpatterns,include,urlfromdjango.contribimportadminadmin.autodiscover()urlpatterns=patterns('',#Examples:#url(r'^$','tango_with_django_project.views.home',name='home'),#url(r'^tango_with_django_project/',incl

python - ImportError : No module named catkin_pkg. 包

我正在尝试运行:-roslaunchturtlebot_gazeboturtlebot_world.launch但是我得到以下错误Traceback(mostrecentcalllast):File"/opt/ros/kinetic/share/xacro/xacro.py",line55,inimportxacroFile"/opt/ros/kinetic/lib/python2.7/dist-packages/xacro/__init__.py",line42,infromroslaunchimportsubstitution_argsFile"/opt/ros/kinetic/l

python - GDB pretty-print ImportError : No module named 'printers'

我正在尝试添加prettyprinting对于Ubuntu14.04上我的GDB中的STL。有关工具的一些详细信息:操作系统:Ubuntu14.04gdb版本:7.7python版本:2.7.6python3版本:3.4.0但是在我完全按照说明进行设置之后。我仍然收到以下错误:Traceback(mostrecentcalllast):File"",line3,inFile"/home/jerry/myLib/gdb_stl_support/python/libstdcxx/v6/__init__.py",line19,infromprintersimportregister_libs

python - 导入错误 : dynamic module does not define init function

我正在尝试重现以下教程https://csl.name/post/c-functions-python/.我在C++中的Python扩展看起来像:#includestaticPyObject*py_myFunction(PyObject*self,PyObject*args){char*s="HellofromC!";returnPy_BuildValue("s",s);}staticPyObject*py_myOtherFunction(PyObject*self,PyObject*args){doublex,y;PyArg_ParseTuple(args,"dd",&x,&y);r

python - 属性错误 : ‘module’ object has no attribute 'scores'

尝试使用nltk.metrics.scores中的函数precision时出现错误。我尝试了许多不同的导入,但都没有成功。我查看了我的python目录中的文件(见下文),功能在那里,但只是“不能触摸这个/那个”。我看了看:/usr/local/lib/python2.7/dist-packages/nltk/metrics/usr/local/lib/python2.7/dist-packages/nltk/metrics/scores.py这是我的终端显示给我的:File"/home/login/projects/python-projects/test.py",line39,inp

python - pylab导入错误: No module named _thread

从ubuntu10.04开始,我使用easy_install安装了pylab。升级后,我可以导入pylab。首先,我运行从easy_install安装的ipython:$ipythonPython2.6.5(r265:79063,Apr162010,13:09:56)Type"copyright","credits"or"license"formoreinformation.IPython0.11--AnenhancedInteractivePython.?->IntroductionandoverviewofIPython'sfeatures.%quickref->Quickrefe

Python:AttributeError: 'module' 对象没有属性 'AddReference'?

我正在尝试使用clr.AddReference和clr.AddReferenceToFile导入程序集,但python(2.7)一直出现此错误:Traceback(mostrecentcalllast):File"",line1,inclr.AddReference("UnityEngine")AttributeError:'module'objecthasnoattribute'AddReference'谁能告诉我如何解决这个问题。 最佳答案 曾经遇到过这个问题。有一个名为clr的包,而pythonnet包的别名也是clr。所以我