New install of PyCharm, never installed before, I let it do it’s default setup, and to test I ran this:
print("I love pizza")
and got this:
Traceback (most recent call last):
File "C:\Users\joel\AppData\Local\Programs\Python\Python310\lib\site.py", line 186, in addpackage
exec(line)
File "<string>", line 1, in <module>
ValueError: source code string cannot contain null bytes
Remainder of file ignored
I love pizza
Process finished with exit code 0
I’ve completely removed and reinstalled 3 times with the same result.
I’m on a fully updated Windows 10 x64 laptop. Any suggestions how to fix?
Looks like you have a bad .pth file - these are used to specify additional search paths for packages, and may contain code. Is there any more console output, it should tell you the relevant file and path? If not, you can also try running python -v, which makes it print all the .pth files as they’re loaded.
Further testing showed a few files that were affected in some way, but couldn’t find anything wrong with the lines and code that were referenced. But then I don’t know 100% what to look for, although nothing looked out of place to my knowledge.
I just won’t use PyCharm. There are other ways to run code.
Yes, I have Notepad set to UTF-8, so that’s all good.
I’m thinking it’s a PyCharm bug. After installation I immediately typed the print command I mentioned, so I had done nothing with Notepad or anything else yet. I’ve informed PyCharm of the issue, hopefully they’ll look into because I do like it.
Thanks for the heads up that this can occur in any IDE, depending on the various factors.