0

When I run the following one on spyder or atom, I get 'ascii'.

import sys
print(sys.getdefaultencoding())

However, if I run this from terminal, I get 'utf-8'.

Why? I want to use the same default encoding everywhere.

  • check this https://stackoverflow.com/questions/2276200/changing-default-encoding-of-python – sudo Oct 24 '17 at 13:03
  • Add `print(sys.version)`. My guess is that for the terminal it is a Python 3 version and for the others Python 2. – cdarke Oct 24 '17 at 13:18

1 Answers1

0

This is almost certainly because they're different versions of Python. The version of Python being used by Atom is determined by the package that you have decided to use. If you're using iPython outside of Atom, then it might be beneficial for you to use hydrogen from within Atom. The interfaces should be extremely similar. If you need to use different versions of Python, the script-running packages generally have the ability to set up different profiles and configurations.

Holland Wilson
  • 701
  • 4
  • 16