Python having issues with Atom on Linux

I am a Python 3 developer currently using Atom on Ubuntu 16.10, and have been having issues with Python integrations in all sorts of packages. Every single one from terminals to script executors are spitting out this error:

Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'

Current thread 0x00007fd8d3071700 (most recent call first):

I don’t know why this is happening but would appreciate any help given.

Does this help?

No, I don’t have virtualenv installed on python3.

Just to reiterate that Python3 does work in all other programs and in CLI. Atom is the only one with issues.

It has to be something in Atom’s environment. A terminal created by a package in Atom should act just like a terminal created by your emulator of choice, but its environment is inherited from Atom. But if Python is missing something that it normally uses to identify the encoding of a file, then maybe that’s a generic error that could use a better error message.

I can think of two things to test. Try running a file with explicit encoding, to see if that stops Python complaining. And apparently, the error can crop up on Linux when there’s a permissions issue, so you can check that out and see if it’s similar to your situation.

I tried specifying the encoding and environment at the top of the script, and running as superuser but neither did anything to solve the problem…
I’m confused as to why this might be happening…

I am as well.

probably the package uses python2 to run your codes
first I suggest you to use “atom-python-run” package
go to the settings by pressing ctrl-,
install the package
then go to the package settings and set the command for “f5” to python3 {file}
this worked for me