草庐IT

check_installed

全部标签

python - 安装.py : installing just a pth file?

作为构建自定义python的最后一步,我需要添加一个myproject.pth。目前我在Makefile中这样做:install:rm-f../../lib/python2.6/site-packages/myproject.pthcpmyproject.pth../../lib/python2.6/site-packages/myproject.pth但我想将其封装在setup.py中。不幸的是setup.py文档似乎没有涵盖这个微不足道的案例!任何帮助表示赞赏。我试过这个但它不起作用:fromsetuptoolsimportsetupsetup(packages=['mypacka

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 - pip 安装 Pandas : installing dependencies error

我正在尝试在虚拟环境中pipinstallpandas,但我遇到了一个我真的不明白的错误。我猜它与Doublerequirementgiven有关,但我真的不知道从这里该何去何从。 最佳答案 我在Python3.4上遇到了同样的错误。而这个错误的根本原因是"pandas0.21-0.22nolongersupportsPython3.4"查看有关此问题的更多信息:https://github.com/pandas-dev/pandas/issues/20775ProblemwithinstallingpandasforPython3

python 2.7 windows silent installer (.msi) - 设置路径的命令行选项?

当使用静默安装程序(.msi)在Windows上安装python2.7时,是否有命令行选项将Python添加到路径环境变量,如GUI选项?Python3.5安装程序默认包含一个选项PrependPath=0,但是Python2.7可以使用它吗?https://docs.python.org/3/using/windows.html这里似乎讨论了这个问题,但没有针对Python2.7的解决方案?https://bugs.python.org/issue3561编辑这个批处理命令太棒了!!!setx\MPATH"%PATH%;C:\Python\Python27;C:\Python\Pyt

python - setup.py 中的 install_requires 取决于安装的 Python 版本

这个问题在这里已经有了答案:install_requiresbasedonpythonversion(2个答案)关闭2年前。我的setup.py看起来像这样:fromdistutils.coreimportsetupsetup([...]install_requires=['gevent','ssl','configobj','simplejson','mechanize'],[...])在Python2.6(或更高版本)下,ssl模块的安装失败:ValueError:ThisextensionshouldnotbeusedwithPython2.6orlater(alreadybui

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 - 你如何使用 easy_install 安装 django 旧版本?

我刚刚因为django1.3破坏了我的环境。我的网站都无法运行。所以,我决定使用virtualenv来设置不同版本的python和django的虚拟环境。但是,如果我下载软件包并使用“sudopythonsetup.pyinstall”进行安装,这似乎不会添加到我的虚拟环境中,而是添加到我的原始环境中。我在虚拟环境virtualenv_name/bin文件夹中尝试了“easy_installdjango”,它成功了,但问题是django1.3被自动选择并被添加。我想安装django1.2.5,有没有一种方法可以轻松地安装到我的虚拟环境中? 最佳答案

python - pip install numpy (python 2.7) 失败,错误代码为 1

我在python2.7.9上通过pip安装numpy...我检查了piplist,它返回了pip(1.5.6),setuptools(12.0.4)。我在Windows764位上运行,我已经尝试过Python32和64位版本。pipinstallnumpy结束于:CommandC:\Python27\python.exe-c"importsetuptools,tokenize;__file__='c:\\users\\jon\\appdata\\local\\temp\\pip_build_jon\\numpy\\setup.py';exec(compile(getattr(token

python - 合作实验室 : How to install and use on local machine?

GoogleColab非常好用,但我希望我可以完全在本地和离线运行Colab笔记本,就像从本地提供的Jupyter笔记本一样?我该怎么做?有没有我可以安装的Colab包?编辑:之前对该问题的一些回答似乎提供了访问由Google托管的Colab的方法。但这不是我要找的。我的问题是如何pipinstallcolab以便在pipinstalljupyter之后像jupyter一样在本地运行它。Colab包似乎不存在,所以如果我需要它,我该怎么做才能从源安装它? 最佳答案 从这里Githublink,似乎GoogleColab可能不会(或保