[Solved]-EOFError: marshal data too short

18๐Ÿ‘

I also encountered the error:

EOFError: marshal data too short.

Even though no changes were made to any of the existing files, this error was thrown.

Some *.pyc files get created automatically which are compiled byte code of a script, which gets dynamically created when a Python script runs to speed up future launches.

I am using an Oracle VM VirtualBox manager, working on Python.

I was trying to install pyspark.
The spark folder structure was something like this

spark****/python/pyspark 

Under this folder contained a folder by name โ€˜__pycache__โ€™
I went to the pyspark folder and deleted the โ€˜__pycache__โ€™ folder using the command:

rm -r __pycache__/

This eliminated the error for me and I am now able to import pyspark.

Hope this helps.

7๐Ÿ‘

I delete all .pyc files using terminal and it worked for me

find . -name \*.pyc -delete
๐Ÿ‘คZohab Ali

Leave a comment