1

I'm trying to import MinMaxScaler from sklearn.preprocessing. when I run my code this error appears that refers to the import line:

ValueError: source code string cannot contain null bytes.

I checked and updated all of the requirements for scikit-learn and the error still appears. I also tried to open a blank python file with only this line :

from sklearn.preprocessing import MinMaxScaler

but it didn't help.

What can I do?

*I'm using windows 10.

shira1954
  • 21
  • 4
  • The import works fine for me. It seems to me that, for some reason, you have null bytes in you're imported file. You could try to remove the null bytes from the file, see [this answer](https://stackoverflow.com/a/39087441/8873143). – funie200 Jan 20 '20 at 16:56
  • The answer you add is to Max OS X 10.10.3 and I'm using Windows 10 – shira1954 Jan 20 '20 at 17:08
  • You could try [this](https://stackoverflow.com/a/42970838/8873143) or maybe just reinstall the package. – funie200 Jan 20 '20 at 19:34

1 Answers1

0

I had the same error (with numpy module) and it was caused by a power outtage. the requirements.txt instalation with pip was interrupted resulting in a corrupted module.

I went manually to the site-packages folders, deleted numpy and installed it again using pip install numpy

After that problem was solved. Hope this helps!

MariusMihai92
  • 19
  • 1
  • 6