首页 > 解决方案 > 如何使用 Poetry 安装 Tweepy?

问题描述

当我尝试通过运行此命令进行安装时poetry add tweepy,它返回此错误:

    (base) angellanaigaga@Angellas-MBP plugin-template % poetry add tweepy
Using version ^3.10.0 for tweepy

Updating dependencies
Resolving dependencies... (13.6s)

  CalledProcessError

  Command '['git', '--git-dir', '/var/folders/pt/17xvwz550hx9hkhw2wv0zpbr0000gn/T/pypoetry-git-wr1sgu4u/.git', '--work-tree', '/var/folders/pt/17xvwz550hx9hkhw2wv0zpbr0000gn/T/pypoetry-git-wr1sgu4u', 'checkout', 'demo']' returned non-zero exit status 1.

  at ~/opt/anaconda3/lib/python3.8/site-packages/poetry/utils/_compat.py:217 in run
      213│                 process.wait()
      214│                 raise
      215│             retcode = process.poll()
      216│             if check and retcode:
    → 217│                 raise CalledProcessError(
      218│                     retcode, process.args, output=stdout, stderr=stderr
      219│                 )
      220│         finally:
      221│             # None because our context manager __exit__ does not use them.

标签: pythontweepypython-poetry

解决方案


我无法重现这个:

>poetry add tweepy
Using version ^3.10.0 for tweepy

Updating dependencies
Resolving dependencies...

Writing lock file

Package operations: 12 installs, 0 updates, 0 removals

  • Installing oauthlib (3.1.1)
  • Installing pysocks (1.7.1)
  • Installing atomicwrites (1.4.0)
  • Installing attrs (21.2.0)
  • Installing more-itertools (8.8.0)
  • Installing py (1.10.0)
  • Installing colorama (0.4.4)
  • Installing pluggy (0.13.1)
  • Installing wcwidth (0.2.5)
  • Installing requests-oauthlib (1.3.0)
  • Installing pytest (5.4.3)
  • Installing tweepy (3.10.0)

这似乎是您项目的其他依赖项之一的问题。

据我所知,它似乎正在尝试安装一个(可能是无名的?) git 依赖项的demo分支,该分支可能不存在。

没有看到你的 pyproject.toml 就很难确定更多。


推荐阅读