从存储库中以编程方式安装pip会导致错误“无此文件或目录”

疯狂的

在win 10上,我将安装到py 3.6 venv。从终端

pip install --upgrade git+git://github.com/larochew/py_daemoniker.git@cfd8a669975c217f6df7063be8cb8fbc08b5f0df#egg=daemoniker

工作良好:

Connected to pydev debugger (build 192.5728.105)
  Running command git clone -q git://github.com/larochew/py_daemoniker.git 'C:\Users\user\AppData\Local\Temp\pip-install-g9do107m\daemoniker'
Collecting daemoniker
  Cloning git://github.com/larochew/py_daemoniker.git (to revision cfd8a669975c217f6df7063be8cb8fbc08b5f0df) to c:\users\user\appdata\local\temp\pip-install-g9do107m\daemoniker
  Running command git checkout -q cfd8a669975c217f6df7063be8cb8fbc08b5f0df
Installing collected packages: daemoniker
    Running setup.py install for daemoniker: started
    Running setup.py install for daemoniker: finished with status 'done'
Successfully installed daemoniker-0.2.3

但是从代码:

try:
    from pip import main as pipmain
except:
    from pip._internal import main as pipmain

pipmain.main(['install', '--upgrade', 'git+git://github.com/larochew/py_daemoniker.git@cfd8a669975c217f6df7063be8cb8fbc08b5f0df#egg=daemoniker'])

结果是:

Collecting daemoniker
  Cloning git://github.com/larochew/py_daemoniker.git (to revision cfd8a669975c217f6df7063be8cb8fbc08b5f0df) to c:\users\user\appdata\local\temp\pip-install-64iunozy\daemoniker
  Running command git clone -q git://github.com/larochew/py_daemoniker.git 'C:\Users\user\AppData\Local\Temp\pip-install-64iunozy\daemoniker'
  Running command git checkout -q cfd8a669975c217f6df7063be8cb8fbc08b5f0df
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'C:\\Users\\user\\AppData\\Local\\Temp\\pip-req-tracker-qu0hrtol\\9eeeef850bab53900fe60a86b33217ba700f6f3907aadc10a37ed11f'

尽管安装了普通软件包,但没有错误。

疯狂的

由于我需要从Windows下的代码静默安装需求,因此以下代码可以解决问题:

        subprocess.check_call(
            [executable, '-m', 'pip', 'install', '--upgrade', '-r', config['requirements_file']],
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE
        )

如果没有stdout=subprocess.PIPEpd的stdout,将进入当前进程。同样,这不会在win中创建终端。Thnx将领导@sinoroc评论

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

在单行命令中使用grep-awk和sed会导致“无此文件或目录”错误

在bash脚本中查找命令仅导致目录出现“无此文件或目录”错误?

麻线显示“无此文件或目录”错误

Windows pip在错误的目录中安装库

无此文件或目录

无此文件或目录:

无此文件或目录

无此文件或目录

在MacOS HighSierra上安装qiskit错误:无此文件或目录:'qiskit.egg-info'

安装的软件包lsleases,给出bash“无此文件或目录”错误

原始资源Uri导致FileNotFoundException(无此文件或目录)

尝试在Android中复制SQLite数据库并获取“无此文件或目录”

当我在Docker容器中执行Shell脚本时,错误是“无此文件或目录”

如何在收到“无此文件或目录”错误消息时从brew中删除virtualbox

在ASP.NET Core中构建docker:“无此文件或目录”错误

错误:ENOENT:无此文件或目录,在ionic2中打开

在ASP.NET Core中构建docker:“无此文件或目录”错误

在NixOS中构建Haskell Stack示例时出现“ ghc-cabal:无此文件或目录”错误

如何让grep无法打印出“无此文件或目录”错误?

接收后挂钩生成“无此文件或目录”错误

查找-禁止显示“无此文件或目录”错误

使用pip安装tensorflow会导致错误

节点js表示安装错误“ EACCES”,“无此文件”

在python中安装Twisted失败,出现“无此文件”

无法删除<文件>:无此文件或目录

Makefile:目标文件“无此文件或目录”

以编程方式确定pip的“用户安装”位置脚本目录

python子进程,无此文件或目录

libcurand.so.9.2:无法打开共享库文件:无此文件或目录