Try setting encoding explicitly:
PYTHONIOENCODING=utf-8 python3 script.py
Learn to set up and develop Python applications in Ubuntu with this interactive guide
Ubuntu ships with Python pre-installed. For development:
sudo apt update && sudo apt install python3-pip
Verify installation: python3 --version
python3 -m venv myenv source myenv/bin/activate
Exit virtual env: deactivate
# hello.py
print("Hello from Ubuntu!")
Run: python3 hello.py
pip install --upgrade pip pip install numpy pandas
Freeze dependencies: pip freeze > requirements.txt
Try setting encoding explicitly:
PYTHONIOENCODING=utf-8 python3 script.py
Different environments: Check with
which python3 which pip3
Want to contribute? Fork our documentation repo on GitHub