Le 10/12/2017 à 21:46, dieter (dieter) a écrit :
Cutter <n...@spam.com> writes:
...
I have trouble installing pylint on Windows 10, Python 3.6. There's a
problem during the installation of wrapt, which is a dependency of
pylint.
Here are the contents of the commandline:
C:\WINDOWS\system32>python -m pip install pylint
...
Collecting wrapt (from astroid>=1.5.1->pylint)
Using cached wrapt-1.10.11.tar.gz
Installing collected packages: colorama, wrapt, astroid, pylint
Running setup.py install for wrapt ... error
Exception:
Traceback (most recent call last):
File "C:\Users\(...)\AppData\Local\Programs\Python\Python36\lib\site-packa
ges\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 51:
invalid start byte
Obviously, something causes some "s" to be decoded using the "stdout" encoding
(which usually is the system encoding). In your case, this encoding is "utf-8",
but "s" does not seem to be utf-8 encoded.
I would use debugging to find out what "s" is, where is comes from and why it
does not use the "stdout" encoding.
I don't know how to use pdb. Instead, I've added the following
instruction at line 73 before the error occurs:
print("!! TEST !! : ", s)
Here's the output now:
> C:\WINDOWS\system32>python -m pdb
C:\Users\(...)\AppData\Local\Programs\Python\Python36\Lib\site-packages\pip\__main__.py
install pylint
>>
c:\users\(...)\appdata\local\programs\python\python36\lib\site-packages\pip\__main__.py(1)<module>()
> -> from __future__ import absolute_import
> (Pdb) c
> Requirement already satisfied: pylint in
c:\users\(...)\appdata\local\programs\python\python36\lib\site-packages
> Requirement already satisfied: mccabe in
c:\users\(...)\appdata\local\programs\python\python36\lib\site-packages
(from pylint)
> Requirement already satisfied: six in
c:\users\(...)\appdata\local\programs\python\python36\lib\site-packages
(from pylint)
> Requirement already satisfied: isort>=4.2.5 in
c:\users\(...)\appdata\local\programs\python\python36\lib\site-packages
(from pylint)
> Requirement already satisfied: astroid<2.0 in
c:\users\(...)\appdata\local\programs\python\python36\lib\site-packages
(from pylint)
> Requirement already satisfied: colorama; sys_platform == "win32" in
c:\users\(...)\appdata\local\programs\python\python36\lib\site-packages
(from pylint)
> Requirement already satisfied: lazy-object-proxy in
c:\users\(...)\appdata\local\programs\python\python36\lib\site-packages
(from astroid<2.0->pylint)
> Collecting wrapt (from astroid<2.0->pylint)
> Using cached wrapt-1.10.11.tar.gz
> !! TEST !! : b'running egg_info\r\n'
> !! TEST !! : b'creating pip-egg-info\\wrapt.egg-info\r\n'
> !! TEST !! : b'writing pip-egg-info\\wrapt.egg-info\\PKG-INFO\r\n'
> !! TEST !! : b'writing dependency_links to
pip-egg-info\\wrapt.egg-info\\dependency_links.txt\r\n'
> !! TEST !! : b'writing top-level names to
pip-egg-info\\wrapt.egg-info\\top_level.txt\r\n'
> !! TEST !! : b"writing manifest file
'pip-egg-info\\wrapt.egg-info\\SOURCES.txt'\r\n"
> !! TEST !! : b"warning: manifest_maker: standard file '-c' not
found\r\n"
> !! TEST !! : b'\r\n'
> !! TEST !! : b"reading manifest file
'pip-egg-info\\wrapt.egg-info\\SOURCES.txt'\r\n"
> !! TEST !! : b"writing manifest file
'pip-egg-info\\wrapt.egg-info\\SOURCES.txt'\r\n"
> !! TEST !! : b''
> Building wheels for collected packages: wrapt
> Running setup.py bdist_wheel for wrapt ... !! TEST !! : b'usage:
-c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]\r\n'
> -!! TEST !! : b' or: -c --help [cmd1 cmd2 ...]\r\n'
> !! TEST !! : b' or: -c --help-commands\r\n'
> !! TEST !! : b' or: -c cmd --help\r\n'
> !! TEST !! : b'\r\n'
> !! TEST !! : b"error: invalid command 'bdist_wheel'\r\n"
> !! TEST !! : b''
> error
> Complete output from command
C:\Users\(...)\AppData\Local\Programs\Python\Python36\python.exe -u -c
"import setuptools,
tokenize;__file__='C:\\Users\\(...)\\AppData\\Local\\Temp\\pip-build-4_065lch\\wrapt\\setup.py';f=getattr(tokenize,
'open', open)(__file__);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d
C:\Users\(...)\AppData\Local\Temp\tmpzyfae43tpip-wheel- --python-tag cp36:
> usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
> or: -c --help [cmd1 cmd2 ...]
> or: -c --help-commands
> or: -c cmd --help
>
> error: invalid command 'bdist_wheel'
>
> ----------------------------------------
> Failed building wheel for wrapt
> Running setup.py clean for wrapt
> !! TEST !! : b'running clean\r\n'
> !! TEST !! : b"'build\\lib.win-amd64-3.6' does not exist -- can't
clean it\r\n"
> !! TEST !! : b"'build\\bdist.win-amd64' does not exist -- can't
clean it\r\n"
> !! TEST !! : b"'build\\scripts-3.6' does not exist -- can't clean
it\r\n"
> !! TEST !! : b''
> Failed to build wrapt
> Installing collected packages: wrapt
> Running setup.py install for wrapt ... !! TEST !! : b'running
install\r\n'
> -!! TEST !! : b'running build\r\n'
> !! TEST !! : b'running build_py\r\n'
> !! TEST !! : b'creating build\r\n'
> !! TEST !! : b'creating build\\lib.win-amd64-3.6\r\n'
> !! TEST !! : b'creating build\\lib.win-amd64-3.6\\wrapt\r\n'
> !! TEST !! : b'copying src\\wrapt\\arguments.py ->
build\\lib.win-amd64-3.6\\wrapt\r\n'
> !! TEST !! : b'copying src\\wrapt\\decorators.py ->
build\\lib.win-amd64-3.6\\wrapt\r\n'
> !! TEST !! : b'copying src\\wrapt\\importer.py ->
build\\lib.win-amd64-3.6\\wrapt\r\n'
> !! TEST !! : b'copying src\\wrapt\\wrappers.py ->
build\\lib.win-amd64-3.6\\wrapt\r\n'
> !! TEST !! : b'copying src\\wrapt\\__init__.py ->
build\\lib.win-amd64-3.6\\wrapt\r\n'
> !! TEST !! : b'running build_ext\r\n'
> !! TEST !! : b"building 'wrapt._wrappers' extension\r\n"
> !! TEST !! : b'creating build\\temp.win-amd64-3.6\r\n'
> \!! TEST !! : b'creating build\\temp.win-amd64-3.6\\Release\r\n'
> !! TEST !! : b'creating build\\temp.win-amd64-3.6\\Release\\src\r\n'
> !! TEST !! : b'creating
build\\temp.win-amd64-3.6\\Release\\src\\wrapt\r\n'
> !! TEST !! : b'C:\\Program Files (x86)\\Microsoft Visual
Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.11.25503\\bin\\HostX86\\x64\\cl.exe
/c /nologo /Ox /W3 /GL /DNDEBUG /MD
-IC:\\Users\\(...)\\AppData\\Local\\Programs\\Python\\Python36\\include
-IC:\\Users\\(...)\\AppData\\Local\\Programs\\Python\\Python36\\include
"-IC:\\Program Files (x86)\\Microsoft Visual
Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.11.25503\\ATLMFC\\include"
"-IC:\\Program Files (x86)\\Microsoft Visual
Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.11.25503\\include"
"-IC:\\Program Files (x86)\\Windows
Kits\\10\\include\\10.0.16299.0\\ucrt" "-IC:\\Program Files
(x86)\\Windows Kits\\10\\include\\10.0.16299.0\\shared" "-IC:\\Program
Files (x86)\\Windows Kits\\10\\include\\10.0.16299.0\\um" "-IC:\\Program
Files (x86)\\Windows Kits\\10\\include\\10.0.16299.0\\winrt"
/Tcsrc/wrapt/_wrappers.c
/Fobuild\\temp.win-amd64-3.6\\Release\\src/wrapt/_wrappers.obj\r\n'
> !! TEST !! : b'_wrappers.c\r\n'
> !! TEST !! : b"src/wrapt/_wrappers.c(195): warning C4244:
'return'\xff: conversion de 'Py_hash_t' en 'long', perte possible de
donn\x82es\r\n"
> error
> Exception:
> Traceback (most recent call last):
> File
"C:\Users\(...)\AppData\Local\Programs\Python\Python36\Lib\site-packages\pip\compat\__init__.py",
line 74, in console_to_str
> return s.decode(sys.__stdout__.encoding)
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position
51: invalid start byte
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
> File
"C:\Users\(...)\AppData\Local\Programs\Python\Python36\Lib\site-packages\pip\basecommand.py",
line 215, in main
> status = self.run(options, args)
> File
"C:\Users\(...)\AppData\Local\Programs\Python\Python36\Lib\site-packages\pip\commands\install.py",
line 342, in run
> prefix=options.prefix_path,
> File
"C:\Users\(...)\AppData\Local\Programs\Python\Python36\Lib\site-packages\pip\req\req_set.py",
line 784, in install
> **kwargs
> File
"C:\Users\(...)\AppData\Local\Programs\Python\Python36\Lib\site-packages\pip\req\req_install.py",
line 878, in install
> spinner=spinner,
> File
"C:\Users\(...)\AppData\Local\Programs\Python\Python36\Lib\site-packages\pip\utils\__init__.py",
line 676, in call_subprocess
> line = console_to_str(proc.stdout.readline())
> File
"C:\Users\(...)\AppData\Local\Programs\Python\Python36\Lib\site-packages\pip\compat\__init__.py",
line 76, in console_to_str
> return s.decode('utf_8')
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position
51: invalid start byte
> The program exited via sys.exit(). Exit status: 2
>>
c:\users\(...)\appdata\local\programs\python\python36\lib\site-packages\pip\__main__.py(1)<module>()
> -> from __future__ import absolute_import
Apparently _wrappers.c is compiled with MSVC but the Python script
managing the installation can't handle a warning from MSVC containing a
special character. _wrappers.c is deleted right after the installation
fails so I can't look into it.
Also wrapt's setup.py doesn't recognize the command "bdist_wheel" ...
I can't go much further than that.
--
https://mail.python.org/mailman/listinfo/python-list