安装pydrive报错: AttributeError: ‘str‘ object has no attribute ‘name‘

在尝试安装PyDrive时遇到AttributeError:'str' object has no attribute 'name'的问题。错误源于元数据生成失败。解决方法是在pip命令前加上'py-m',并指定镜像源。执行'py-m pip install pydrive -i https://pypi.mirrors.ustc.edu.cn/simple/'后,成功解决了安装问题。
摘要由CSDN通过智能技术生成

安装pydrive报错: AttributeError: ‘str’ object has no attribute ‘name’

一些版本信息

  • python版本是3.73
  • 没有没有pip版本未更新问题
  • conda的base环境

错误提示:


(base) C:\Users\28340>pip install pydrive -i https://pypi.mirrors.ustc.edu.cn/simple/
Looking in indexes: https://pypi.mirrors.ustc.edu.cn/simple/
Collecting pydrive
  Downloading https://mirrors.bfsu.edu.cn/pypi/web/packages/52/e0/0e64788e5dd58ce2d6934549676243dc69d982f198524be9b99e9c2a4fd5/PyDrive-1.3.1.tar.gz (987 kB)
     ---------------------------------------- 987.4/987.4 KB 3.0 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      Traceback (most recent call last):
        File "<string>", line 36, in <module>
        File "<pip-setuptools-caller>", line 14, in <module>
        
错误省略
........

packages\setuptools\_vendor\importlib_metadata\__init__.py", line 886, in find_distributions
          found = self._search_paths(context.name, context.path)
      AttributeError: 'str' object has no attribute 'name'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

解决方法:

在前面加上py -m就可以解决,后面是使用的一个镜像,快速安装。

py -m pip install pydrive -i https://pypi.mirrors.ustc.edu.cn/simple/

成功解决:在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值