Python und Python setuptools unter Windows 7 installieren

Folgende Schritte sind nötig, um Python auf einem Windows 7 (64-Bit) Betriebssystem zu installieren:

  1. Windows X86-64 MSI Installer für Python 2.7.3 herunterladen und installieren,
    Beispielpfad: C:\dev\env\python\Python 2.7.3
  2. Python Benutzervariable hinzufügen:
    Windows+Pause > Erweiterte Systemeinstellungen > Umgebungsvariablen
    Neue Benutzervariable > Name: %PYTHON_PATH% > Wert: C:\dev\env\python\Python 2.7.3

  3. Benutzervariable „path“ erweitern mit ;%PYTHON_PATH%;%PYTHON_PATH%\Scripts

Sobald das getan ist, kann auf der cmd der Befehl python ausgeführt werden. Damit die Python setuptools installiert werden können, muss Python aber noch in der Windows Registry eingetragen werden. Dazu legen wir eine Datei mit den Namen python.reg an, in die wir folgenden Inhalt schreiben:

Windows Registry Editor Version 5.00
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\InstallPath]
@="C:\\dev\\env\\python\\Python 2.7.3"
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\InstallPath\InstallGroup]
@="Python 2.7.3"
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\PythonPath]
@="C:\\dev\\env\\python\\Python 2.7.3\\Lib;C:\\dev\\env\\python\\Python 2.7.3\\DLLs;C:\\dev\\env\\python\\Python 2.7.3\\Lib\\lib-tk"

Nach dem Abspeichern der Datei kann mit einem Doppelklick auf die Datei Python in die Registry eingetragen werden. Sobald das erledigt ist, dürfen wir die Python setuptools für Python 2.7 installieren.

Wenn wir alles richtig gemacht haben, wird uns während der Installation folgendes Fenster angezeigt:

Wenn alles installiert worden ist, kann in der cmd das Kommando easy_install zum Installieren von Dateien mit der Dateiendung *.egg verwendet werden.

Error: spawn ENOTSUP when installing socket.io with npm install

If you have installed node.js v0.6.16 for Windows and you want to install socket.io with the following command:

npm install socket.io

Then it could happen that you will get this error message on Windows 7 (64-Bit):

> node install.js
 
npm ERR! Error: spawn ENOTSUP
npm ERR!     at errnoException (child_process.js:483:11)
npm ERR!     at ChildProcess.spawn (child_process.js:446:11)
npm ERR!     at Object.spawn (child_process.js:342:9)
npm ERR!     at spawn (C:\Program Files (x86)\nodejs\node_mod
npm ERR!     at exec (C:\Program Files (x86)\nodejs\node_modu
npm ERR!     at Array.0 (C:\Program Files (x86)\nodejs\node_m
npm ERR!     at EventEmitter._tickCallback (node.js:192:40)

Fortunately, there is a solution! Open this file:

C:\Program Files (x86)\nodejs\node_modules\npm\lib\utils\exec.js

Replace these two lines (around line 109 & 110):

  if (!isNaN(uid)) opts.uid = uid
  if (!isNaN(gid)) opts.gid = gid

That’s all. For more information see: Error on socket.io installing on Windows 7.

With these ones:

  if (uid && !isNaN(uid)) opts.uid = +uid
  if (gid && !isNaN(gid)) opts.gid = +gid