line_探查器安装失败:UnicodeDecodeE

2024-06-06 17:30:13 发布

您现在位置:Python中文网/ 问答频道 /正文

当试图通过pip install line_profiler安装line_profiler时,我总是得到相同的错误:

Installing collected packages: line-profiler
  Running setup.py install for line-profiler ... error
Exception:
Traceback (most recent call last):
  File "c:\program files\python36\lib\site-packages\pip\compat\__init__.py", line 73, in console_to_str
    return s.decode(sys.__stdout__.encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 107: invalid start byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\program files\python36\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "c:\program files\python36\lib\site-packages\pip\commands\install.py", line 342, in run
    prefix=options.prefix_path,
  File "c:\program files\python36\lib\site-packages\pip\req\req_set.py", line 784, in install
    **kwargs
  File "c:\program files\python36\lib\site-packages\pip\req\req_install.py", line 878, in install
    spinner=spinner,
  File "c:\program files\python36\lib\site-packages\pip\utils\__init__.py", line 676, in call_subprocess
    line = console_to_str(proc.stdout.readline())
  File "c:\program files\python36\lib\site-packages\pip\compat\__init__.py", line 75, in console_to_str
    return s.decode('utf_8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 107: invalid start byte

注意:我手动地将cl.exe添加到路径变量中,因为我无法使vcvarsall.bat x64工作。在

有什么办法解决这个问题吗?我使用的是Python3.6:line\u profiler是否仅适用于Python2.X?在


Tags: installpipinpylibpackageslinesite