Sublime Text3 python Virtual Environment (supplemental)--Fix the console in Chinese garbled condition

Source: Internet
Author: User
Tags sublime text virtual environment virtualenv

Transferred from: Edwardgui's Blog

The normal use of Python to compile the console is not garbled, but in the case of using a virtual environment, Chinese is always garbled, the first thought is the Windows console encoding problem. Looking for a long time after the discovery is python+virtualenv compiler system problems, and now I will lead you to solve this problem.

▲ Note: Under Windows environment
    • First look at whether the Virtualenv package plugin has been installed, if not, then Ctrl+shift+p,install package, enter VIRTUALENV installation.
    • Find the plug-in installation: C:\users{username}\appdata\roaming\sublime Text 3\installed Packages ==> pay attention to change Username
    • Unzip the Virtualenv.sublime-package file by first adding the suffix. zip to Virtualenv.sublime-package.zip and unzip

The Include files are as follows:

To modify the Python + virtualenv.sublime-build file, add a line:"env": {"PYTHONIOENCODING": "utf8"},
Make it into

{"env": {"PYTHONIOENCODING": "utf8"},"target": "virtualenv_exec","shell_cmd": "python -u \"$file\"","file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)","selector": "source.python"}

Then save, then package the file as Virtualenv.sublime-package.zip and remove the suffix, and you're done.

Finally open sublime Text3 use Python + virtualenv compile, you can see the normal output of Chinese!

Sublime Text3 python Virtual Environment (supplemental)--Fix the console in Chinese garbled condition

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.