pip uninstall GDAL 给出 AttributeError: 'PathMetadata'对象没有属性“isdir”;
我正在尝试将 pip install geopandas
作为全新安装,因此我想删除 GDAL
和 fiona
等现有软件包。我已经成功pip uninstall fiona
,但是当我尝试卸载或重新安装GDAL
时,它会显示以下错误消息:
(base) C:\usr>pip install C:/usr/Anaconda3/Lib/site-packages/GDAL-3.4.1-cp38-cp38-win_amd64.whl
Processing c:\usr\anaconda3\lib\site-packages\gdal-3.4.1-cp38-cp38-win_amd64.whl
Installing collected packages: GDAL
Attempting uninstall: GDAL
Found existing installation: GDAL 3.0.2
ERROR: Exception:
Traceback (most recent call last):
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\cli\base_command.py", line 167, in exc_logging_wrapper
status = run_func(*args)
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\cli\req_command.py", line 205, in wrapper
return func(self, options, args)
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\commands\install.py", line 405, in run
installed = install_given_reqs(
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\req\__init__.py", line 68, in install_given_reqs
uninstalled_pathset = requirement.uninstall(auto_confirm=True)
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\req\req_install.py", line 637, in uninstall
uninstalled_pathset = UninstallPathSet.from_dist(dist)
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\req\req_uninstall.py", line 554, in from_dist
for script in dist.iterdir("scripts"):
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\metadata\pkg_resources.py", line 156, in iterdir
if not self._dist.isdir(name):
File "C:\usr\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2816, in __getattr__
return getattr(self._provider, attr)
AttributeError: 'PathMetadata' object has no attribute 'isdir'
有谁知道为什么GDAL
代码>无法卸载?
I'm trying to pip install geopandas
as a fresh installation, so I want to remove existing packages like GDAL
and fiona
. I've already managed to pip uninstall fiona
, but when I try to uninstall or reinstall GDAL
it gives the following error message:
(base) C:\usr>pip install C:/usr/Anaconda3/Lib/site-packages/GDAL-3.4.1-cp38-cp38-win_amd64.whl
Processing c:\usr\anaconda3\lib\site-packages\gdal-3.4.1-cp38-cp38-win_amd64.whl
Installing collected packages: GDAL
Attempting uninstall: GDAL
Found existing installation: GDAL 3.0.2
ERROR: Exception:
Traceback (most recent call last):
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\cli\base_command.py", line 167, in exc_logging_wrapper
status = run_func(*args)
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\cli\req_command.py", line 205, in wrapper
return func(self, options, args)
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\commands\install.py", line 405, in run
installed = install_given_reqs(
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\req\__init__.py", line 68, in install_given_reqs
uninstalled_pathset = requirement.uninstall(auto_confirm=True)
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\req\req_install.py", line 637, in uninstall
uninstalled_pathset = UninstallPathSet.from_dist(dist)
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\req\req_uninstall.py", line 554, in from_dist
for script in dist.iterdir("scripts"):
File "C:\usr\Anaconda3\lib\site-packages\pip\_internal\metadata\pkg_resources.py", line 156, in iterdir
if not self._dist.isdir(name):
File "C:\usr\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2816, in __getattr__
return getattr(self._provider, attr)
AttributeError: 'PathMetadata' object has no attribute 'isdir'
Does anyone know why GDAL
cannot be uninstalled?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在遇到同样的错误后才遇到这个问题。巧合的是,我刚刚升级了 pip(我厌倦了黄色警告)。
我所要做的就是降低我的点子等级
I just came across this question after getting the same error. Coincidentally I had just upgraded pip (I was getting tired of the yellow warnings).
All I had was to down grade my pip
当我尝试安装
google-cloud-firestore
时,我看到了与您相同的AttributeError
。我的解决方案是升级我的 pip 版本。就我而言,我从 22.0.2 升级到 pip 到 22.3.1I was seeing the same
AttributeError
as you when trying to installgoogle-cloud-firestore
. My solution was to upgrade my version of pip. In my case, I upgraded to pip from 22.0.2 to 22.3.1