Was bedeutet die Python-Nachricht?
-
19-08-2019 - |
Frage
ho-fe3fdd00-12:~ Sam$ easy_install BeautifulSoup
Traceback (most recent call last):
File "/usr/bin/easy_install", line 8, in <module>
load_entry_point('setuptools==0.6c7', 'console_scripts', 'easy_install')()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/setuptools/command/easy_install.py", line 1670, in main
with_ei_usage(lambda:
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/setuptools/command/easy_install.py", line 1659, in with_ei_usage
return f()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/setuptools/command/easy_install.py", line 1674, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/core.py", line 125, in setup
dist.parse_config_files()
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py", line 373, in parse_config_files
parser.read(filename)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ConfigParser.py", line 267, in read
self._read(fp, filename)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ConfigParser.py", line 462, in _read
raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /Users/Sam/.pydistutils.cfg, line: 1
'install_lib = ~/Library/Python/$py_version_short/site-packages\n'
Ich versuche beautifulsoup zu installieren. Die ersten beiden Zeilen in ~ / .pydistutils.cfg:
install_lib = ~/Library/Python/$py_version_short/site-packages
install_scripts = ~/bin
Lösung
BeautifulSoup ist ein reines Python-Modul, das Sie durch Greifen der BeautifulSoup.py Datei installieren und es irgendwo auf Ihrer PythonPath setzen (zB aus dem Innern der Standard .tar.gz Distribution.) - zB. innerhalb /Users/Sam/Library/Python/2.5/site-packages, wenn die Pfade in der Fehlermeldung erwähnt sind korrekt.
Keine Notwendigkeit für pingelig und fehleranfällige Installateure, die gerade das Problem verkomplizieren.
Andere Tipps
Die Konfigurationsdatei .pydstutils.cfg hat einen Syntaxfehler.
Versuchen Sie, die Linie an der Spitze des ~/.pydistutils.cfg
hinzuzufügen:
[easy_install]
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow