草庐IT

Check_Program_Installed

全部标签

python - 警告 (theano.sandbox.cuda) : CUDA is installed, 但设备 gpu 不可用(错误:cuda 不可用)

在UbuntuMATE16.04中,我尝试使用GPU在此处运行深度学习python示例:testingTheanowithGPU我确实运行了示例代码,THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32pythoncheck1.py不过好像用的是CPU,不是GPU。这是终端输出的最后一部分:WARNING(theano.sandbox.cuda):CUDAisinstalled,butdevicegpu0isnotavailable(error:cudaunavailable)...Usedthecpu我也试过运行这段代码:THEAN

Python 子进程 check_output 比调用慢得多

我试图理解为什么会这样。我正在调用命令以在Ubuntu服务器12.04上重新启动网络。快速执行当我使用以下三种方式之一调用命令时,执行大约需要0.1秒:直接在终端使用os.system的python脚本使用subprocess.call的python脚本终端session:root@ubuntu:~#time/etc/init.d/networkingrestart*Running/etc/init.d/networkingrestart*Reconfiguringnetworkinterfaces...real0m0.105sroot@ubuntu:~#timepython-c"im

python - 如何避免 flake 8's "F821 undefined name '_' “when _ has been installed by gettext?

问题概述:在我的项目的主脚本中,gettext安装函数_(),该函数在其他模块中用于翻译(如print(_('Something翻译'))).如thedoc所述:the_()function[is]installedinPython’sbuiltinsnamespace,soitiseasilyaccessibleinallmodulesofyourapplication.所以,一切正常。唯一的问题:flake8显示错误(实际上由PyFlakes返回):$flake8*.pylib.py:2:12:F821undefinedname'_'main_script.py:8:7:F821u

python - Mercurial 预提交 Hook : How to hook to python program in current directory?

我正在尝试创建一个MercurialHook,该Hook在提交被推送到主存储库时运行。我创建了一个python脚本,如下所示:#commit.pyfrommercurialimportui,hgfrommercurial.i18nimportgettextas_defgetV1ID(ui,repo,**kwargs):ui.write("Thehookworks!!!")v1id=ui.prompt('EntertheVersionOneID')ui.write('VersionOneID:'+v1id)对于每个分支,此commit.py都是重复的,因为它包含在代码被推送到主存储库之前

python - 在 Python 中 : check if file modification time is older than a specific datetime

我用C#编写了这段代码来检查文件是否已过期:DateTime?lastTimeModified=file.getLastTimeModified();if(!lastTimeModified.HasValue){//Filedoesnotexist,soitisoutofdatereturntrue;}if(lastTimeModified.Value我如何用python编写这个?我在python中试过了。statbuf=os.stat(filename)if(statbuf.st_mtime我得到以下异常messagestr:unsupportedoperandtype(s)for-

python - Anaconda: cannot import cv2 even though opencv is installed (how to install opencv3 for python3)

我安装了Anaconda(版本:conda4.2.9,python3)并尝试执行importcv2时出现以下错误:ImportError:Nomodulenamed'cv2'使用condasearchcv2我得到这个:opencv2.4.2np15py26_0defaults2.4.2np15py27_0defaults2.4.2np16py26_0defaults2.4.2np16py27_0defaults2.4.2np17py26_0defaults2.4.2np17py27_0defaults2.4.2np15py26_1defaults2.4.2np15py27_1defau

python - 加密 : AssertionError ("PID check failed. RNG must be re-initialized after fork(). Hint: Try Random.atfork()")

我正在创建执行不同任务的各种流程。其中之一,也是唯一一个,有一个创建PyCrypto对象的安全模块。所以我的程序启动,创建各种进程,处理消息的进程使用安全模块解密,我得到以下错误:firstSymKeybin=self.cipher.decrypt(encFirstSymKeybin,'')File"/usr/local/lib/python2.7/dist-packages/Crypto/Cipher/PKCS1_v1_5.py",line206,indecryptm=self._key.decrypt(ct)File"/usr/local/lib/python2.7/dist-pa

python - 导入错误 : No module named lxml - Even though LXML Is installed

我收到此错误“ImportError:Nomodulenamedlxml”,即使确实安装了LXML。具体来说,它安装在项目的pythonVirtualenv中。最终我正在研究Python/AmazonProductAPI.尝试从终端(mac)运行该项目的示例脚本之一后出现错误。我该如何解决这个问题?或进一步追踪问题?Google搜索引导我:重新编译LXML确保同意Xcode许可证:sudoxcodebuild-license通过以下方式更新LXML:pipinstall--upgradelxml当前版本为3.4.0按照概述重新安装了LXML依赖项here-pipinstalllibxm

python - `python setup.py check` 实际上是做什么的?

pythonsetup.pycheck到底做了什么? 最佳答案 第一站,distutilspackagedocumentation:Thecheckcommandperformssometestsonthemeta-dataofapackage.Forexample,itverifiesthatallrequiredmeta-dataareprovidedastheargumentspassedtothesetup()function.因此它会测试您是否正确填写了元数据;在创建Python包时将其视为质量控制步骤。接下来,我们可以检

python - 如何在 INSTALLED_APPS 中包含必备应用

我有一个正在构建的Django应用程序,我们将其称为foo。由于Foo的构建方式,它需要许多第三方django应用程序才能运行。例如,要运行Foo,安装应用程序可能如下所示:INSTALLED_APPS=('prereq1',prereq2','foo')事实上,要使Foo发挥作用,必须在django中安装'prereq1',prereq2'。现在,我可以将要求添加到requirements.txt或setup.py以确保在有人安装Foo时安装库,但是我不知道是否有办法将它们安装在Django本身中。这样做的原因是如果有人想使用Foo,我不想包括像这样的指令:InyourINSTALL