草庐IT

find_module

全部标签

python - 狮身人面像 : list of functions in a module

我有一些python模块,主要包含函数和一些类。每一个都在单独的第一个文件中使用sphinx-autodoc进行记录。我想做的是在每个页面的顶部创建一个表或模块内容列表,例如,mymodule.py是deffirst():'Firstfunction'defsecond():'Secondfunction'而mymodule.rst是PageContents-------------:create_page_contents_list:Members-------..automodule::mymodule:members:那么输出应该是这样的:PageContents--------

python - gevent 库 : "Import Error: no module named greenlet"

大家好,我下载了一个需要geventpython库的脚本,每次运行该脚本时,它都会显示:File"shodan.py",line7,infromgeventimportmonkeyFile"C:\Python27\lib\site-packages\gevent\__init__.py",line48,infromgevent.greenletimportGreenlet,joinall,killallFile"C:\Python27\lib\site-packages\gevent\greenlet.py",line6,infromgevent.hubimportgreenlet,g

python - Py 安装程序 "ImportError: No module named Pyinstaller"

这是我运行pythonconfigure.py时生成的代码。dan@Q430-Q530:~/pyinstaller-2.0/PyInstaller$pythonconfigure.pyTraceback(mostrecentcalllast):File"configure.py",line28,infromPyInstallerimportHOMEPATH,PLATFORMImportError:NomodulenamedPyInstaller因此,目前,由于缺少一个名为...PyInstaller的模块,我什至无法运行PyInstaller。这是PyInstaller2.0,您可以找

Python 导入优先级 : packages or modules?

我不清楚如何正确命名这个问题。案例一假设我有以下目录结构。foo|+-bar/__init__.py|+-bar.py如果我有fromfooimportbar我如何知道正在导入哪个柱(bar.py或bar/__init__.py)?有什么简单的方法可以自动检测这种情况的发生吗?案例二foo|+-foo.py|+-other.py如果other.py有这行importfoo我如何知道正在导入哪个foo(foo或foo.foo)?同样,是否有任何简单的方法可以自动检测这种情况的发生? 最佳答案 TLDR;如果包在同一目录中,则包优先于同

python - 导入错误 : No module named enum on python 2. 7

我正在使用Python2.7运行代码。我得到“ImportError:没有名为enum的模块”。我用“pipinstallenum”安装了枚举,但错误不断出现。我该怎么办?? 最佳答案 你想要backport:pipinstallenum34不幸的是,PyPI上名为enum的发行版是另外一回事。 关于python-导入错误:Nomodulenamedenumonpython2.7,我们在StackOverflow上找到一个类似的问题: https://stac

python - zc.buildout 停止工作 : ImportError: No module named apport. fileutils

我已经使用buildout很长一段时间了,没有任何问题,事实上我昨天没有遇到任何问题。但就像今天一样,我所有的项目都未能扩建。我在两个不同的Ubuntu工作站上尝试了相同的结果。这是我得到的错误:Initializingzc.buildoutDebug:Downloadinghttp://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.eggTraceback(mostrecentcalllast):File"bootstrap.py",line259,inimportzc.buildout.build

python - 导入错误 : No module named pxssh

我正在尝试使用pxssh模块与客户端建立SSH连接-但是我得到:ImportError:Nomodulenamedpxssh我在Python安装中找到了这个文件,所以我猜是正确的:/usr/lib/python2.7/site-packages/pexpect/pxssh.py当然,我正在使用Python2.7运行我的应用程序,我什至尝试导入pexpect,但这没有帮助。 最佳答案 好吧,试试frompexpectimportpxssh。更新:该解决方案仅适用于Linux,因为Windows不支持pxssh

主要报错:10% building 2/2 modules 0 activeError: error:0308010C:digital envelope rout

项目场景:主要报错:10%building2/2modules0activeError:error:0308010C:digitalenveloperout报错内容:PSC:\Users\815\Desktop\新建文件夹(2)\login>npmrunserveDebuggerattached.>snow@0.1.0serve>vue-cli-serviceserveDebuggerattached.INFOStartingdevelopmentserver...10%building0/1modules1active...ckPath=/sockjs-nodeC:\Users\815\De

python 2.7 : log displayed twice when `logging` module is used in two python scripts

上下文:Python2.7。同一文件夹中的两个文件:首先:主脚本。第二:自定义模块。目标:可以在没有任何冲突的情况下使用logging模块(见下面的输出)。文件:a.py:importloggingfrombimporttest_bdeftest_a(logger):logger.debug("debug")logger.info("info")logger.warning("warning")logger.error("error")if__name__=="__main__":#Customlogger.logger=logging.getLogger("test")formatt

python - pip 安装损坏(pkg_resources.find_distribution 在 req.py-prepare_files 中返回空列表)

在某些时候我的pip安装坏了(我怀疑是在升级到Ubuntu14.04时),我无法通过完全删除它并重新安装(通过synaptic包管理器)来恢复它。它不会发生在所有包中,但会发生在一些常见的包中,例如autopep8甚至setuptools本身。我得到的错误是DownloadingfromURLhttps://pypi.python.org/packages/3.3/p/pep8/pep8-1.5.6-py2.py3-none-any.whl#md5=c7da9fb6a4316b53b6a873de076441e2(fromhttps://pypi.python.org/simple/p