美文网首页呆鸟的Python数据分析
使用pipenv出现utf-8不能decode的问题

使用pipenv出现utf-8不能decode的问题

作者: 违规昵称不予展示 | 来源:发表于2018-10-11 20:50 被阅读54次

报错:UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

这是我的报错:
F:\fisher>pipenv install
Traceback (most recent call last):
File "f:\python3\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "f:\python3\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "F:\python3\Scripts\pipenv.exe_main
.py", line 5, in <module>
File "f:\python3\lib\site-packages\pipenv_init
.py", line 23, in <module>
from .cli import cli
File "f:\python3\lib\site-packages\pipenv\cli_init.py", line 3, in <module>
from .command import cli
File "f:\python3\lib\site-packages\pipenv\cli\command.py", line 7, in <module>
import crayons
File "f:\python3\lib\site-packages\pipenv\patched\crayons.py", line 48, in <module>
is_powershell = "powershell" in shellingham.detect_shell()[0]
File "f:\python3\lib\site-packages\pipenv\vendor\shellingham_init
.py", line 22, in detect_shell
shell = get_shell(pid, max_depth=max_depth)
File "f:\python3\lib\site-packages\pipenv\vendor\shellingham\nt.py", line 100, in get_shell
processes = dict(_iter_process())
File "f:\python3\lib\site-packages\pipenv\vendor\shellingham\nt.py", line 78, in _iter_process
info = {'executable': str(pe.szExeFile.decode('utf-8'))}
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

首先提醒大家不是路径有中文的问题,所以卸载重装一个英文路径是没有用的,别问我是怎么知道的TVT(这不可能)

在网上找了好多方法,都试了,然而没啥用,但是到最后我的操作过程是

  • 卸载(已经卸载好多次了)
  • 电脑崩溃了
  • 重启
  • 找到一开始安装的文件夹(他的默认安装文件夹C:\Users\yww\AppData\Local\Programs\Python\)
  • 删除遗留的东西——重新安装(在英文路径中)
  • △执行pip install setuptools==34.3.3
  • 执行python -m pip install --upgrade pip
  • 执行pip install pipenv
  • 执行pipenv install
    太开心了

不过最后想了一下好像可能也许是执行pip install setuptools==34.3.3这一句的功劳

相关文章

网友评论

    本文标题:使用pipenv出现utf-8不能decode的问题

    本文链接:https://www.haomeiwen.com/subject/uzqiaftx.html