I finally have found the solution.
The error occurs because sys.stdout is not a binary stream but rather a text stream.
To fix:
Open the compact. py file located in c: \program files\python311\lib\site-packages\pycampbellcr1000.
Find the line that reads stdout = sys.stdout. buffer and replace it with stdout = getattr(sys.stdout, 'buffer', sys.stdout)
Save the file and re run the code.