ImportError: Pandas requires version '0.3.0' or newer of 's3fs'

I'm trying to read files from S3, using boto3, pandas, anaconda, but I have the following error:

ImportError: Pandas requires version '0.3.0' or newer of 's3fs' 
(version '0.1.6' currently installed).

How can I update the s3fs version?

This is my code:

import boto3 
import pandas as pd
s3 = boto3.resource('s3')
bucket= s3.Bucket('bucketname')
files = list(bucket.objects.all())
files
objects = bucket.objects.filter(Prefix='bucketname/')
objects = bucket.objects.filter(Prefix=Teste/)
file_list = []
for obj in objects:
df = pd.read_csv(f's3://bucketname/{obj.key}')
file_list.append(df)
final_df = pd.concat(file_list)
print (final_df.head(4))

Topic error-handling aws pandas python

Category Data Science


The error message is telling you exactly what is wrong here - you need to update the python package.

Steps:

  1. Open your terminal

  2. Type the command:

    pip install s3fs --upgrade
    

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.