Einfach mal paar Module in Python3 installieren?

Probleme bei der Installation?
Antworten
Serpens66
User
Beiträge: 259
Registriert: Montag 15. Dezember 2014, 00:31

Wie sinnvoll ist es einfach mal ein paar Top Module zu installieren? Kann es schaden?
Ich dachte mir also, dass ich einfach mal die Top 20 von hier installiere:
https://freepythontips.wordpress.com/20 ... e-without/

Aber scheinbar ist das nicht so einfach wie gedacht, denn schon beim zweiten Modul "Scrapy" macht mir die Ausgabe in der Powershell ein wenig Angst, dass ich damit mehr kaputtmache, als dass es nützt, da soviele Fehler auftreten.
Also was läuft da verkehrt?

Die paar fettgedruckten Dinge (hauptsächlich "............") im Quote habe ich fürs posten etwas abgeändert:
pip install scrapy
Downloading/unpacking scrapy
Running setup.py (path:C:.................scrapy\setup.py) egg_info for package scrap
y

no previously-included directories found matching 'docs\build'
Downloading/unpacking Twisted>=10.0.0 (from scrapy)
Running setup.py (path:C:\.................Twisted\setup.py) egg_info for package Twis
ted

file twisted.py (for module twisted) not found
file twisted\internet.py (for module twisted.internet) not found
file twisted\internet\test.py (for module twisted.internet.test) not found
file twisted\names.py (for module twisted.names) not found
file twisted\names\test.py (for module twisted.names.test) not found
file twisted\protocols.py (for module twisted.protocols) not found
file twisted\protocols\test.py (for module twisted.protocols.test) not found
file twisted\python.py (for module twisted.python) not found
file twisted\python\test.py (for module twisted.python.test) not found
file twisted\test.py (for module twisted.test) not found
file twisted\trial.py (for module twisted.trial) not found
file twisted\trial\test.py (for module twisted.trial.test) not found
file twisted\web.py (for module twisted.web) not found
file twisted\web\test.py (for module twisted.web.test) not found
Downloading/unpacking w3lib>=1.8.0 (from scrapy)
Downloading w3lib-1.10.0-py2.py3-none-any.whl
Downloading/unpacking queuelib (from scrapy)
Downloading queuelib-1.2.2-py2.py3-none-any.whl
Downloading/unpacking lxml (from scrapy)
Running setup.py (path:C:\.......................\lxml\setup.py) egg_info for package lxml
Building lxml version 3.4.1.
Building without Cython.
ERROR: b'Der Befehl "xslt-config" ist entweder falsch geschrieben oder\r\nkonnte nicht gefunden werden.\r\n'
** make sure the development packages of libxml2 and libxslt are installed **

Using build configuration of libxslt
C:\Python34\lib\distutils\dist.py:260: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)

warning: no previously-included files found matching '*.py'
Downloading/unpacking pyOpenSSL (from scrapy)
Running setup.py (path:C:\..............\pyOpenSSL\setup.py) egg_info for package py
OpenSSL

warning: no previously-included files matching '*.pyc' found anywhere in distribution
no previously-included directories found matching 'doc\_build'
Downloading/unpacking cssselect>=0.9 (from scrapy)
Downloading cssselect-0.9.1.tar.gz
Running setup.py (path:C:\...............\pip_build_Serpens\cssselect\setup.py) egg_info for package cs
sselect

no previously-included directories found matching 'docs\_build'
Downloading/unpacking six>=1.5.2 (from scrapy)
Downloading six-1.8.0-py2.py3-none-any.whl
Downloading/unpacking zope.interface>=4.0.2 (from Twisted>=10.0.0->scrapy)
Running setup.py (path:C:\...............\pip_build_Serpens\zope.interface\setup.py) egg_info for packa
ge zope.interface

warning: no previously-included files matching '*.dll' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
Downloading/unpacking cryptography>=0.2.1 (from pyOpenSSL->scrapy)
Requirement already satisfied (use --upgrade to upgrade): setuptools in c:\python34\lib\site-packages (from zope.interfa
ce>=4.0.2->Twisted>=10.0.0->scrapy)
Downloading/unpacking cffi>=0.8 (from cryptography>=0.2.1->pyOpenSSL->scrapy)
Downloading/unpacking enum34 (from cryptography>=0.2.1->pyOpenSSL->scrapy)
Downloading enum34-1.0.4.tar.gz
Running setup.py (path:C:\................\pip_build_Serpens\enum34\setup.py) egg_info for package enum3
4

Downloading/unpacking pyasn1 (from cryptography>=0.2.1->pyOpenSSL->scrapy)
Running setup.py (path:C:\...............\pip_build_Serpens\pyasn1\setup.py) egg_info for package pyasn
1

Downloading/unpacking pycparser (from cffi>=0.8->cryptography>=0.2.1->pyOpenSSL->scrapy)
Running setup.py (path:C:\....................\pip_build_Serpens\pycparser\setup.py) egg_info for package py
cparser

Installing collected packages: scrapy, Twisted, w3lib, queuelib, lxml, pyOpenSSL, cssselect, six, zope.interface, crypto
graphy, cffi, enum34, pyasn1, pycparser
Running setup.py install for scrapy

no previously-included directories found matching 'docs\build'
Installing scrapy-script.py script to C:\Python34\Scripts
Installing scrapy.exe script to C:\Python34\Scripts
Installing scrapy.exe.manifest script to C:\Python34\Scripts
File "C:\Python34\Lib\site-packages\scrapy\contrib\downloadermiddleware\ajaxcrawl.py", line 64
_ajax_crawlable_re = re.compile(ur'<meta\s+name=["\']fragment["\']\s+content=["\']!["\']/?>')
^
SyntaxError: invalid syntax

Running setup.py install for Twisted
file twisted.py (for module twisted) not found
file twisted\internet.py (for module twisted.internet) not found
file twisted\internet\test.py (for module twisted.internet.test) not found
file twisted\names.py (for module twisted.names) not found
file twisted\names\test.py (for module twisted.names.test) not found
file twisted\protocols.py (for module twisted.protocols) not found
file twisted\protocols\test.py (for module twisted.protocols.test) not found
file twisted\python.py (for module twisted.python) not found
file twisted\python\test.py (for module twisted.python.test) not found
file twisted\test.py (for module twisted.test) not found
file twisted\trial.py (for module twisted.trial) not found
file twisted\trial\test.py (for module twisted.trial.test) not found
file twisted\web.py (for module twisted.web) not found
file twisted\web\test.py (for module twisted.web.test) not found
file twisted.py (for module twisted) not found
file twisted\internet.py (for module twisted.internet) not found
file twisted\internet\test.py (for module twisted.internet.test) not found
file twisted\names.py (for module twisted.names) not found
file twisted\names\test.py (for module twisted.names.test) not found
file twisted\protocols.py (for module twisted.protocols) not found
file twisted\protocols\test.py (for module twisted.protocols.test) not found
file twisted\python.py (for module twisted.python) not found
file twisted\python\test.py (for module twisted.python.test) not found
file twisted\test.py (for module twisted.test) not found
file twisted\trial.py (for module twisted.trial) not found
file twisted\trial\test.py (for module twisted.trial.test) not found
file twisted\web.py (for module twisted.web) not found
file twisted\web\test.py (for module twisted.web.test) not found

file twisted.py (for module twisted) not found
file twisted\internet.py (for module twisted.internet) not found
file twisted\internet\test.py (for module twisted.internet.test) not found
file twisted\names.py (for module twisted.names) not found
file twisted\names\test.py (for module twisted.names.test) not found
file twisted\protocols.py (for module twisted.protocols) not found
file twisted\protocols\test.py (for module twisted.protocols.test) not found
file twisted\python.py (for module twisted.python) not found
file twisted\python\test.py (for module twisted.python.test) not found
file twisted\test.py (for module twisted.test) not found
file twisted\trial.py (for module twisted.trial) not found
file twisted\trial\test.py (for module twisted.trial.test) not found
file twisted\web.py (for module twisted.web) not found
file twisted\web\test.py (for module twisted.web.test) not found
file twisted.py (for module twisted) not found
file twisted\internet.py (for module twisted.internet) not found
file twisted\internet\test.py (for module twisted.internet.test) not found
file twisted\names.py (for module twisted.names) not found
file twisted\names\test.py (for module twisted.names.test) not found
file twisted\protocols.py (for module twisted.protocols) not found
file twisted\protocols\test.py (for module twisted.protocols.test) not found
file twisted\python.py (for module twisted.python) not found
file twisted\python\test.py (for module twisted.python.test) not found
file twisted\test.py (for module twisted.test) not found
file twisted\trial.py (for module twisted.trial) not found
file twisted\trial\test.py (for module twisted.trial.test) not found
file twisted\web.py (for module twisted.web) not found
file twisted\web\test.py (for module twisted.web.test) not found
Running setup.py install for lxml
Building lxml version 3.4.1.
Building without Cython.
ERROR: b'Der Befehl "xslt-config" ist entweder falsch geschrieben oder\r\nkonnte nicht gefunden werden.\r\n'
** make sure the development packages of libxml2 and libxslt are installed **

Using build configuration of libxslt
building 'lxml.etree' extension
C:\Python34\lib\distutils\dist.py:260: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
error: Unable to find vcvarsall.bat
Complete output from command C:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:\\.................\\pip_build_Serpens\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replac
e('\r\n', '\n'), __file__, 'exec'))" install --record C:\.................\pip-ru7se7mw-record\install-reco
rd.txt --single-version-externally-managed --compile:
Building lxml version 3.4.1.

Building without Cython.

ERROR: b'Der Befehl "xslt-config" ist entweder falsch geschrieben oder\r\nkonnte nicht gefunden werden.\r\n'

** make sure the development packages of libxml2 and libxslt are installed **



Using build configuration of libxslt

running install

running build

running build_py

creating build

creating build\lib.win32-3.4

creating build\lib.win32-3.4\lxml

copying src\lxml\builder.py -> build\lib.win32-3.4\lxml

copying src\lxml\cssselect.py -> build\lib.win32-3.4\lxml

[von mir gekürzt, diverse "copying", kann ich wenn gebraucht noch nachliefern]

running build_ext

building 'lxml.etree' extension

C:\Python34\lib\distutils\dist.py:260: UserWarning: Unknown distribution option: 'bugtrack_url'

warnings.warn(msg)

error: Unable to find vcvarsall.bat

----------------------------------------
Cleaning up...
Command C:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:\\................\\pip_buil
d_Serpens\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__
, 'exec'))" install --record C:\................\pip-ru7se7mw-record\install-record.txt --single-version-e
xternally-managed --compile failed with error code 1 in C:\..............\pip_build_Serpens\lxml
Storing debug log for failure in C:\....................\pip\pip.log
BlackJack

@Serpens66: Es gibt nicht alles für Python 3. Twisted gibt es zum Beispiel noch nicht für Python 3, ein ``pip install`` wird das trotzdem einfach versuchen und auf die Nase fallen — wie man sieht. `wxPython` gibt es für Python 3 soweit ich weiss auch noch nicht in einer stabilen Version.

Ausserdem würde ich unter Windows mit `pip` nur reine Python-Module installieren. Denn nur das wird problemlos funktionieren, sofern es ein passendes Package/Modul für Python 3 gibt. Für Module die C-Code enthalten muss ein passender C-Compiler vorhanden sein, und wenn externe C-Bibliotheken eingebunden werden müssen die und deren Headerdateien und Unterstützungsskripte (`xslt-config` zum Beispiel) vorher installiert worden sein, so dass der C-Compiler die finden kann. Und wenn dabei etwas nicht wie erwartet funktioniert, muss man die Fehlermeldungen vom C-Compiler oder -Linker oder vom ``make``-Befehl verstehen können und wissen was zu tun ist.

Unter Windows würde ich persönlich erst einmal schauen ob's da schon etwas fertig kompiliertes gibt.

Die Liste in dem Blogbeitrag ist ein wenig eigenartig. Das sind angeblich 20 Module ohne die ”man” nicht leben kann. Das mag für den Autor stimmen, aber die Interessen der Leute sind verschieden und auf der Liste ist nicht alles allgemein verwendbar. Zum Beispiel werden bestimmt sehr viele Programmierer ihr ganzes Leben ohne ein Modul auskommen können mit dem man IP-Pakete auf Protokollebene analysieren kann. Bei `nltk` fällt dem Autor des Beitrags dann auch selber auf dass das wohl nicht wirklich jeder benötigen wird. Einige Module sind auch redundant. Bei `scrapy` steht das man nach diesem Modul kein anderes mehr verwenden will, aber trotzdem wird einige Punkte weiter `BeautifulSoup` aufgezählt. Und ob man nun wirklich `wxPython` *und* `PyQt` *und* `PyGtk` braucht? Und warum nicht auch `PySide` und `PyGobject`/`gi`?

Hast Du denn vor die Module auch alle zu verwenden? Also weisst Du schon bei jedem Modul wofür Du es verwenden willst oder hast zumindest zeitnah vor das Modul auszuprobieren und Dich da reinzuarbeiten? Auch ohne Bezug zu einem konkreten Problem? Dabei geht Dir doch nach eigenen Angaben schnell die Motivation abhanden — ist installieren auf ”Vorrat” dann sinnvoll?
Serpens66
User
Beiträge: 259
Registriert: Montag 15. Dezember 2014, 00:31

danke für deine Antwort.

Der Gedanke, einfach die "wichtigsten" Module schonmal zu installieren kam mir halt wegen dem urllib2 Problem. Ich dachte, wenn ich einfach schonmal alles installiere, dann hab ich später nicht das Problem, dass ein Skript aufgrund eines fehlenden Moduls nicht funktioniert.
Allerdings scheit es ja wirklich extrem viele Module zu geben, weshalb es wohl wirklich nicht sinnvoll ist "alles" zu installieren.

Eigentlich sollte ich ja schon wissen, was es alles gibt und was hilfreich ist. Auch deswegen der Gedanke, die "wichtigsten" Module zu installieren, um dadurch die riesige Auswahl etwas zu beschränken und sich erstmal mit diesen wichtigsten Modulen zu beschäftigen.


Habe ich denn jetzt schon irgendwas "kaputt" gemacht? Sollte ich diese halbe installation von Scrapy irgendwie wieder rückgängig machen?


Wo finde ich denn für Windows etwas kompiliertes? Bzw. wie suche ich da nach? Einfach Stichwort "Pyhton 3 windows kompiliert" ? Oder geht es noch etwas spezieller?
BlackJack

@Serpens66: Die ”wichtigsten” Module hängen halt davon ab was man machen möchte. Wenn man etwas mit relationalen Datenbanken machen möchte, dann würde ich SQLAlchemy als ”wichtig” ansehen. Wer nichts damit machen möchte oder garantiert mit einem DB-API 2-Modul für ein bestimmtes DBMS auskommt und kein ORM braucht, dem reicht vielleicht das Modul für das DBMS. Wer ein „full stack” Webrahmenwerk braucht sollte sich Django anschauen, wer Desktop-Anwendungen entwickelt, der braucht das nicht. Es gibt Leute die Daten plotten wollen, und welche die das nicht benötigen. Und so weiter.

So ganz allgemein nutzbar gibt es nicht allzuviele Module ausserhalb der Standardbibliothek. Vieles ist dort ja schon vorhanden. Von den 20 in dem Blogartikel aufgezählten sind eigentlich nur zwei wirklich ”universell”: `nose` und `ipython`. Wobei letzteres kein Python-Modul ist was man in seinen eigenen Programmen einsetzt, auch wenn das geht, sondern eine bessere interaktive Python-Shell als die Standardshell von Python selbst.

Es gibt ein paar Python-Distributionen für Windows wo schon so einiges dabei ist oder speziell für die jeweilige Distribution einfach nachinstallierbar ist. Und Christoph Gohlke stellt einen ganzen Haufen Vorkompiliertes zur Verfügung: http://www.lfd.uci.edu/~gohlke/pythonlibs/
Antworten