Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

polars.exceptions.InvalidOperationError: file encoding is not UTF-8 #12

Open
Holthuizen opened this issue Jul 31, 2024 · 1 comment
Open

Comments

@Holthuizen
Copy link

I first ran pip install -r requirements.txt in a new .venv
but when running python createMeasurements.py i get the following error:

image
Traceback (most recent call last):
File "D:\CodingProjecs\Python\1brc\createMeasurements.py", line 507, in
measurement.generate_measurement_file(
File "D:\CodingProjecs\Python\1brc\createMeasurements.py", line 463, in generate_measurement_file
data.write_csv(f, separator=sep, float_precision=1, include_header=False)
File "D:\CodingProjecs\Python\1brc.venv\Lib\site-packages\polars\dataframe\frame.py", line 2719, in write_csv
self._df.write_csv(
polars.exceptions.InvalidOperationError: file encoding is not UTF-8

@ifnesi
Copy link
Owner

ifnesi commented Aug 2, 2024

Hi @Holthuizen, thank you. Please pull the latest commit and try again. There were a PR open to fix that and I didn't merge it until now. The problem was when opening the measurement file to write to it the encoding was not set to UTF-8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants