安装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/
成功解决: