草庐IT

specific_install

全部标签

python - easy_install pip == [Errno 8] 提供的节 pip 名或服务名,或未知

我在为通过pythonbrew安装的python2.7.3安装pip时遇到问题:pythonbrewupdate--masterpythonbrewinstall2.7.3--force当试图从pip.openplans.org获取pip时,这在最后阶段挂起时失败了:Installed/Users/andrei/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/distribute-0.6.28-py2.7.eggProcessingdependenciesfordistribute==0.6.28Finished

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 - 'io.h' : No such file or directory during "pip install netifaces"

我尝试通过以下方式在Python3.6.2中安装netifaces:pipinstallnetifaces但是当我在cmd中运行它时,我得到了这个错误:c:\users\seyed_vahid\appdata\local\programs\python\python36\include\pyconfig.h(59):fatalerrorC1083:Cannotopenincludefile:'io.h':Nosuchfileordirectoryerror:command'C:\ProgramFiles(x86)\MicrosoftVisualStudio14.0\VC\bin\cl.

python - pip install -r requirements.txt 来自 puppet ?

我有一个pip样式的requirements.txt文件,用于跟踪我的python依赖项,我正在将我的开发环境转移到vagrant+puppet。到目前为止,我一直在使用puppet中内置的pip提供程序来安装单个软件包,如下所示:package{["django","nose"]:ensure=>present,provider=>pip}是否可以改为传入我的requirements.txt并让puppet在该文件更改时使包保持最新? 最佳答案 是的,这是可能的。不要定义包资源,而是定义一个“exec”资源,它将requireme

python - "pip install"什么时候造轮子?

我发现在不同的文件夹中,有时pipinstall会构建wheel,这会花费很多时间,而有时则不会。我不确定为什么以及如何控制它。我的命令:bin/python-mpipinstall-r../requirements.txt(由于!#shebang行长度限制,所以我不不要直接使用pip)没有造轮子的输出(只需要几秒钟):Collectingnumpy==1.10.4(from-r../requirements.txt(line1))Installingcollectedpackages:numpySuccessfullyinstallednumpy-1.10.4构建轮的输出(至少需要2

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

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 - 如何从 Python 中运行 'python setup.py install'?

我正在尝试创建一个通用的python脚本来启动python应用程序,如果目标系统中缺少任何相关的python模块,我想安装它们。如何从Python本身运行与命令行命令“pythonsetup.pyinstall”等效的命令?我觉得这应该很容易,但我想不通。 最佳答案 对于那些使用设置工具的人,您可以使用setuptools.sandbox:fromsetuptoolsimportsandboxsandbox.run_setup('setup.py',['clean','bdist_wheel'])

python - '错误 : Error -5 while decompressing data: incomplete or truncated stream' when installing pip package

在virtualenv中运行pipinstallPillow==2.9.0时出现以下错误:error:Error-5whiledecompressingdata:incompleteortruncatedstream其他软件包安装/卸载正常,它似乎只影响Pillow2.9.0。我在(或不在)什么virtualenv似乎并不重要。下载源压缩包并从中安装有效,但由于这是在构建服务器上,这不是理想的解决方法,因为我想依赖pipinstall-rrequirements.txt版本:pip--version:来自/usr/local/lib/python2.7/site-packages(py

python - 在 python 脚本中使用 "pip install/uninstall"

这个问题在这里已经有了答案:Installingpythonmodulewithincode(12个答案)关闭2年前。如何在python脚本中使用pip安装软件包?我不使用os.system,我想导入pip并使用它。