Handling Avro File Format in Jupyter Notebook and Pysparkk Shell

Hi

I am trying to save one of dataframe in Avro format on HDFS. I am getting error .I am aware that avro needs to be imported as external package in spark . Just wanted to know how it can be done by writing spark code in jupyter or using any command in pyspark-shell and later how I can use it in jupyter notebook if it is done using pyspark-shell