text 윈도우파이썬유니코드문제。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 윈도우파이썬유니코드문제。相关的知识,希望对你有一定的参考价值。

Problem : 
Windows python throws error when I change codepage to unicode (chcp 65001) and try to use python.

PS C:\Program Files\PowerShell\6.0.0-rc> pip list
Traceback (most recent call last):
  File "d:\python2.7.13\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "d:\python2.7.13\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "D:\Python2.7.13\Scripts\pip.exe\__main__.py", line 5, in <module>
  File "d:\python2.7.13\lib\site-packages\pip\__init__.py", line 28, in <module>
    from pip.vcs import git, mercurial, subversion, bazaar  # noqa
  File "d:\python2.7.13\lib\site-packages\pip\vcs\mercurial.py", line 9, in <module>
    from pip.download import path_to_url
  File "d:\python2.7.13\lib\site-packages\pip\download.py", line 37, in <module>
    from pip.utils.ui import DownloadProgressBar, DownloadProgressSpinner
  File "d:\python2.7.13\lib\site-packages\pip\utils\ui.py", line 57, in <module>
    _BaseBar = _select_progress_class(IncrementalBar, Bar)
  File "d:\python2.7.13\lib\site-packages\pip\utils\ui.py", line 50, in _select_progress_class
    six.text_type().join(characters).encode(encoding)
LookupError: unknown encoding: cp65001
PS C:\Program Files\PowerShell\6.0.0-rc>

Solve:
Add "PYTHONIOENCODING":"utf-8" to vscode or same thing to env PATH.

以上是关于text 윈도우파이썬유니코드문제。的主要内容,如果未能解决你的问题,请参考以下文章

text 윈도파워셸터미널텔넷글자안보임。

text 안드로이드개발컴파일빠르게

markdown 파이썬변수#python #tutorial

python 파이썬콘솔color적용#python

css 숨김 - “이리뷰가도움이되었나요?”의“아니요”버튼

java 백준1009번문제1번째풀이