草庐IT

import-module

全部标签

python - 导入错误 : No module named QtWebKit

我在centos5。我使用makealtinstall安装了python26源代码。然后我做了一个:yuminstallqt4yuminstallqt4-develyuminstallqt4-doc我从riverbankcomputing.co.uk下载了sip4.10.2的源代码,编译并安装正常。然后从同一个站点我从源代码PyQt-x11-4.7.3下载并编译两个安装都使用python26版本(/usr/local/bin/python2.6)。所以configure.py、make和makeinstall都没有错误。最后,我尝试运行这个脚本,但是在这篇文章的主题中得到了错误:imp

Windows 上的 Python 2.7,所有多处理示例的 "assert main_name not in sys.modules, main_name"

简单的代码如下:frommultiprocessingimportProcess,freeze_supportdeffoo():print'hello'if__name__=='__main__':freeze_support()p=Process(target=foo)p.start()它在使用Python3.3的Linux或Windows上运行良好,但在使用Python2.7的Windows上运行失败。Traceback(mostrecentcalllast):File"",line1,inFile"c:\Python27\lib\multiprocessing\forking.p

python - 导入错误 : Failed to import the Cloud Firestore library for Python

尝试在python服务器上集成GooglefirestoreAPI...File"/home/daffolap-355/repos/subscriptions/appvendor/firebase_admin/firestore.py",line28,inraiseImportError('FailedtoimporttheCloudFirestorelibraryforPython.Makesure'ImportError:FailedtoimporttheCloudFirestorelibraryforPython.Makesuretoinstallthe"google-cloud

不降级解决No module named ‘tensorflow.contrib‘

首先这是一个tensorflow1.x和tensorflow2.x的一个冲突,很多tensorflow1.x的包都被删除和移动到别的地方,网上面最多的做法就是降级,降级了不是可能会引发更多的冲突吗,我不是很理解,也有可能是我技术不到家,还没法领悟。下面我将演示自己的改python额外安装包源码的过程。这是在tf2.x的状态:fromtensorflow.contrib.crfimportviterbi_decodeTraceback(mostrecentcalllast): File"C:\Users\csdn\.conda\envs\lastner\Lib\site-packages\foo

python - 我必须安装什么来解决 Could not find any typelib for GtkSource, Cannot import : GtkSourceView, cannot import name GtkSource

我正在尝试为来自https://bugzilla.gnome.org/show_bug.cgi?id=680569的meld应用补丁我自己,我遇到了这个问题:$gitclonegit://git.gnome.org/meld$cdmeld$pythonsetup.pybuild$bin/meld2014-01-1116:30:44,736ERRORroot:CouldnotfindanytypelibforGtkSourceCannotimport:GtkSourceViewcannotimportnameGtkSource我对Python知之甚少,例如不知道(还)什么是Python的

python - numpy.getbuffer 导致 AttributeError : 'module' object has no attribute 'getbuffer'

我想从Python3中的numpy数组中获取缓冲区。我找到了以下代码:$python3Python3.2.3(default,Sep252013,18:25:56)[GCC4.6.3]onlinux2Type"help","copyright","credits"or"license"formoreinformation.>>>importnumpy>>>a=numpy.arange(10)>>>numpy.getbuffer(a)但是它在最后一步产生了错误:Traceback(mostrecentcalllast):File"",line1,inAttributeError:'mod

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

这个问题在这里已经有了答案:DealingwithmultiplePythonversionsandPIP?(27个答案)关闭12个月前。我正在尝试fromCython.Buildimportcythonize并收到消息ImportError:Nomodulenamed'Cython',但我使用命令安装了Cythonpip安装Cython。怎么了?python3.5赛通0.25.2Windows8

imp.new_module() 的 Python importlib 模拟

PyCharm告诉我imp已被弃用,所以我想知道是否有任何importlib的imp.new_module类似物。 最佳答案 引自documentation(Emphasismine)-imp.new_module(name)Returnanewemptymoduleobjectcalledname.Thisobjectisnotinsertedinsys.modules.Deprecatedsinceversion3.4:Usetypes.ModuleTypeinstead.例子->>>importtypes>>>types.Mo

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

我正在尝试让Celery与django一起工作以设置计划任务。我试过查看thefirststepsw/Celery和thefirststepsw/Django教程,但都没有为我工作。这是我的项目布局和相关文件:python3.5.1Django1.10celery4.0.2RabbitMQ3.6.6一次性密码19.2mysite/(projectname)polls/(myapp)tasks...mysite/__init__celerysettings...manage...我的网站/__init__.py:from__future__importabsolute_import,un

python - 在ubuntu上导入caffe时ImportError cannot import name BytesIO

我正在尝试制作caffe在我的机器上运行Ubuntu12.04LTS。完成Installationpage上的所有步骤后,我成功地训练了LeNet模型并尝试将其用作here的教程.然后我得到以下错误:Traceback(mostrecentcalllast):File"",line1,inImportError:NomodulenamedcaffeErrorinsys.excepthook:Traceback(mostrecentcalllast):File"/usr/lib/python2.7/dist-packages/apport_python_hook.py",line66,i