草庐IT

legacy_module

全部标签

python - 使用 PyCharm 隐藏内置名称 "function"和 "module"

我有以下Python代码:function="Developer"module="something"print(function+"on"+module)在PyCharm2017中,我有一个气泡,上面写着“使用PyCharm的阴影内置名称“函数”/“模块””。我很惊讶,因为“函数”和“模块”不是内置名称。它们也不是关键字:import__builtin__importkeywordassert"function"notindir(__builtin__)#->OKassert"module"notindir(__builtin__)#->OKassert"function"notin

python - 运行时错误 : module compiled against API version 0xc but this version of numpy is 0xb

我正在尝试学习机器学习,但无法解决以下错误。[我的环境]MacHighSierra10.13.2Python3.4.5Numpy1.13.3[命令]$python3-c"importjupyter,matplotlib,numpy,pandas,scipy,sklearn"[错误]RuntimeError:modulecompiledagainstAPIversion0xcbutthisversionofnumpyis0xbTraceback(mostrecentcalllast):File"/Users/uekyo/ml/env/lib/python3.4/site-packages

python - 导入错误 : No module named grid_search, learning_curve

Scikit学习问题l无法使用Sklearn和sklearn.grid_search的learning_curve。当我执行importsklearn(有效)fromsklearn.clusterimportbicluster(有效)。我尝试重新安装scikit-learn也仍然是同样的问题。我正在使用python3.5.6,Scikit-learn版本0.20.0Window10。importsklearnfromsklearn.model_selectionimportStratifiedKFold,cross_val_score,train_test_splitfromsklea

python - 导入错误 : No module named 'html.parser' ; 'html' is not a package (python3)

这个问题在这里已经有了答案:Importinginstalledpackagefromscriptwiththesamenameraises"AttributeError:modulehasnoattribute"or"ImportError:cannotimportname"(2个答案)关闭3年前。代码:fromhtml.parserimportHTMLParser追溯(最近的调用最后):File"program.py",line7,infromhtml.parserimportHTMLParserImportError:Nomodulenamed'html.parser';'htm

python - 已经安装了 pyzmq 但仍然得到 "ImportError: No module named zmq"

我正在尝试让ipythonnotebook运行。我已经安装了pyzmq。你知道为什么它仍然给出这个错误吗? 最佳答案 您会看到该错误(手动安装pyzmq)的唯一原因是pyzmq安装到与ipython运行所在位置不同的pythonpath。如果您按照安装说明进行操作,应该没有问题:easy_installipythonpyzmqtornado#orpipinstallipythonpyzmqtornado也有可能安装程序看到依赖已经在另一个位置得到满足并且没有做任何事情,然后ipython可能正在运行一个不同的pythonpath而没

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

我正在使用python3.5,并且正在Coursera上学习算法专业类(class)。教授这门类(class)的教授发布了一个程序,可以帮助我们了解与运行程序相关的时间和内存。它的顶部有importresource命令。我试图将这个程序与我用python编写的程序一起运行,每次我收到ImportError:Nomodulenamed'resource'我在ubuntu中使用了同样的代码,一点错误都没有。我遵循了stackoverflow答案中的建议,并尝试添加PYTHONPATHPYTHONHOME并编辑了PATH环境变量。我不知道我还能在这里做什么。是否有任何文件可以下载并安装到我的

python - 使用 pyinstaller 后执行编译文件 "No module named ' scipy._lib.messagestream' 时出错

我正在尝试编译我们的代码https://bitbucket.org/OES_muni/massiveoes从python2.7升级到3.6并同时移动到scipy1.0.0后使用pyinstaller。我在64位win7机器上工作。程序本身运行良好,pyinstaller运行没有错误,但是当我尝试运行构建exe文件时,它给了我这个错误:Traceback(mostrecentcalllast):File"massiveOES\GUI.py",line23,inFile"c:\users\petr\envs\py1\lib\site-packages\PyInstaller\loader\

python - Pylint 错误消息 : "E1101: Module ' lxml. etree'没有 'strip_tags' 成员'”

我正在试验lxml和python第一次用于个人项目,我正在尝试striptagsfromabitofsourcecodeusingetree.strip_tags().出于某种原因,我不断收到错误消息:“E1101:模块‘lxml.etree’没有‘strip_tags’成员”。我不确定为什么会这样。这是我的代码的相关部分:fromlxmlimportetree...DOC=etree.strip_tags(DOC_URL,'html')printDOC有什么想法吗?谢谢。 最佳答案 原因是pylint默认onlytrustsCex

python - 模块未找到错误 : No module named 'gevent.wsgi'

我在运行flask应用程序时遇到以下错误:fromgevent.wsgiimportWSGIServerModuleNotFoundError:Nomodulenamed'gevent.wsgi'gevent已安装,满足要求pip版本为10.11和Python3.6。操作系统:Windows10x64使用Anaconda虚拟机同样的代码在另一台机器上工作,所以我在某处缺少配置,但我无法跟踪/找到它。from__future__importabsolute_importfrom__future__importdivisionfrom__future__importprint_functi

python - 模块未找到错误 : No module named 'numpy.core._multiarray_umath' (While installing TensorFlow)

我正在按照本教程安装TensorFlow(https://www.tensorflow.org/install/pip),但在最后一个命令中:python-c"importtensorflowastf;tf.enable_eager_execution();print(tf.reduce_sum(tf.random_normal([1000,1000])))"我得到这个结果:ModuleNotFoundError:Nomodulenamed'numpy.core._multiarray_umath'ImportError:numpy.core.multiarrayfailedtoimp