Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Problema no momento de ler a url

O meu código está igual ao moniotor: url = 'https://github.com/alura-cursos/curso_geopandas/raw/main/dados/RJ_Municipios_2022.shp' import geopandas as gpd rj = gpd.read_file(url) Entretanto estou enfrentando a seguinte mensagem de erro: { "name": "AttributeError", "message": "module 'fiona' has no attribute 'path'", "stack": "--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[60], line 1 ----> 1 rj = gpd.read_file(url)

File c:\Users\eduar\AppData\Local\Programs\Python\Python310\lib\site-packages\geopandas\io\file.py:281, in _read_file(filename, bbox, mask, rows, engine, **kwargs) 278 else: 279 path_or_bytes = filename --> 281 return _read_file_fiona( 282 path_or_bytes, from_bytes, bbox=bbox, mask=mask, rows=rows, **kwargs 283 ) 285 else: 286 raise ValueError(f"unknown engine '{engine}'")

File c:\Users\eduar\AppData\Local\Programs\Python\Python310\lib\site-packages\geopandas\io\file.py:299, in _read_file_fiona(path_or_bytes, from_bytes, bbox, mask, rows, where, **kwargs) 293 raise NotImplementedError("where requires fiona 1.9+") 295 if not from_bytes: 296 # Opening a file via URL or file-like-object above automatically detects a 297 # zipped file. In order to match that behavior, attempt to add a zip scheme 298 # if missing. --> 299 if _is_zip(str(path_or_bytes)): 300 parsed = fiona.parse_path(str(path_or_bytes)) 301 if isinstance(parsed, fiona.path.ParsedPath): 302 # If fiona is able to parse the path, we can safely look at the scheme 303 # and update it to have a zip scheme if necessary.

File c:\Users\eduar\AppData\Local\Programs\Python\Python310\lib\site-packages\geopandas\io\file.py:166, in _is_zip(path) 164 def _is_zip(path): 165 """Check if a given path is a zipfile""" --> 166 parsed = fiona.path.ParsedPath.from_uri(path) 167 return ( 168 parsed.archive.endswith(".zip") 169 if parsed.archive 170 else parsed.path.endswith(".zip") 171 )

AttributeError: module 'fiona' has no attribute 'path'" }

1 resposta
solução!

Consegui resolver o problema desinstalando a documentação "fiona" e instalando a documentação "pyogrio".

Sequência de comandos realizados no cmd:

pip uninstall fiona
pip install pyogrio