Python-Plugin für Visual Studio Code installieren

Probleme bei der Installation?
Antworten
aleph
User
Beiträge: 20
Registriert: Donnerstag 19. Januar 2017, 15:28

Ich habe auf Windows 10 64 Visual Studio Code installiert, und dann die Installationsschritte vom Python-Plugin gemacht: https://marketplace.visualstudio.com/it ... nne.python

Code: Alles auswählen

    1. Install the extension
    Make sure jedi and ctags are installed.
    2.     Install jedi using pip install jedi.
    3.    Install ctags from here, or using brew install ctags on OSX.
    If Python is in the current path
        You're ready to use it.
    4. If using a custom Python Version or a Virtual Environment, use the command Select Workspace Interpreter)
1. und 2. hat funktioniert.

zu 3.: Wie installiere ich ctags von http://ctags.sourceforge.net/ ? In der ctags58.zip von der ctags-Webseite sind nur Quelltextdateien und eine ctags.exe. Muss ich die EXE wo hin kopieren? Wohin?

zu 4.: Was muss ich da genau machen?

VS Code will pylint installieren. Dabei kommt folgende Fehlermeldung:

Code: Alles auswählen

Requirement already satisfied: six in c:\users\Username\appdata\local\programs\python\python36\lib\site-packages (from pylint)
Collecting mccabe (from pylint)
  Using cached mccabe-0.5.3-py2.py3-none-any.whl
Collecting wrapt (from astroid<1.5.0,>=1.4.5->pylint)
  Using cached wrapt-1.10.8.tar.gz
Requirement already satisfied: lazy-object-proxy in c:\users\Username\appdata\local\programs\python\python36\lib\site-packages (from astroid<1.5.0,>=1.4.5->pylint)
Installing collected packages: colorama, wrapt, astroid, mccabe, pylint
  Running setup.py install for wrapt ... error
Exception:
Traceback (most recent call last):
  File "C:\Users\Username\AppData\Local\Programs\Python\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 0x94 in position 95: invalid start byte
 
During handling of the above exception, another exception occurred:
 
Traceback (most recent call last):
  File "C:\Users\Username\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\Users\Username\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\commands\install.py", line 342, in run
    prefix=options.prefix_path,
  File "C:\Users\Username\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\req\req_set.py", line 784, in install
    **kwargs
  File "C:\Users\Username\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\req\req_install.py", line 878, in install
    spinner=spinner,
  File "C:\Users\Username\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\Username\AppData\Local\Programs\Python\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 0x94 in position 95: invalid start byte
Was kann ich da machen?
Daikoku
User
Beiträge: 66
Registriert: Montag 20. April 2015, 21:14

Sollte es noch jemanden interessieren.

Die Windows Console oder auch die Windows Powershell arbeiten standardmäßig nicht mit UTF-8.
Benötigt man UTF-8, bitte chcp 65001 am jeweiligen Prompt eingeben. 65001 entspricht hier UTF-8.
Nur zur Info: Der Standartwert in Deutschland ist 850. Ab Windows 10 kann dieser aber auch UTF-16LE sein.

Mit der Eingabe von chcp und dann <enter> drücken, kann die aktuelle Code Page abgefragt werden.

Wenn man nicht ständig eine bestimmte Code Page von Hand eingeben möchte, kann man bei Windows 10:
Start -> Run -> regedit
[HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\Autorun] den Value auf chcp 65001 setzen.

Bitte nur den Value von Autorun ändern, ansonsten bootet das System nicht mehr.
Bitte überlegt auch weiter, was Ihr noch so alles über die Console oder PS erledigt.
Andere Programme mögen UTF-8 nicht unbedingt.
Denkt bitte auch an sonstige Installationen, welche eine Shell bei der Installation benötigen.

Für Benutzer von Windows 7, 8 und 10 gibt es eine weitere bzw. andere Möglichkeit:
1. Ihr erstellt eine Verknüpfung von der powershell.exe und Kopiert diese dann in ein Verzeichnis Eurer Wahl.
2. Auf die Verknüpfung mit der rechten Maustaste, dann auf Eigenschaften und unter Ziel,
hinter powershell.exe -NoExit -Command "chcp 65001" anfügen.
chcp 65001 wird dann beim start dieser Verknüpfung automatisch mit ausgeführt.
Dies gilt aber nur für diese eine Verknüpfung.


Python Installations-Fehler Meldungen bei Windows Systemen wie zum Beispiel:

-> UnicodeDecodeError: 'utf-8' codec can't decode byte 0x94 in position 95: invalid start byte

deuten darauf hin, das vor der Installation ein chcp 65001 eingeben werden sollte.
Antworten