这条Python消息是什么意思?

时间:2022-08-15 16:56:44
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'

I am trying to install beautifulsoup. The first two lines in ~/.pydistutils.cfg:

我正在尝试安装beautifulsoup。 〜/ .pydistutils.cfg中的前两行:

install_lib = ~/Library/Python/$py_version_short/site-packages
install_scripts = ~/bin

3 个解决方案

#1


BeautifulSoup is a pure Python module which you can install by grabbing the BeautifulSoup.py file (eg. from inside the standard .tar.gz distribution) and putting it somewhere on your PythonPath - eg. inside /Users/Sam/Library/Python/2.5/site-packages, if the paths mentioned in the error message are accurate.

BeautifulSoup是一个纯Python模块,您可以通过抓取BeautifulSoup.py文件(例如,从标准.tar.gz发行版中)并将其放在PythonPath上的某个位置来安装 - 例如。在/Users/Sam/Library/Python/2.5/site-packages中,如果错误消息中提到的路径是准确的。

No need for fussy and error-prone installers which just overcomplicate the issue.

不需要繁琐且容易出错的安装程序,这些安装程序只会使问题过于复杂。

#2


The configuration file .pydstutils.cfg has a syntax error.

配置文件.pydstutils.cfg有语法错误。

#3


Try to add the line at the top of ~/.pydistutils.cfg:

尝试添加〜/ .pydistutils.cfg顶部的行:

[easy_install]

#1


BeautifulSoup is a pure Python module which you can install by grabbing the BeautifulSoup.py file (eg. from inside the standard .tar.gz distribution) and putting it somewhere on your PythonPath - eg. inside /Users/Sam/Library/Python/2.5/site-packages, if the paths mentioned in the error message are accurate.

BeautifulSoup是一个纯Python模块,您可以通过抓取BeautifulSoup.py文件(例如,从标准.tar.gz发行版中)并将其放在PythonPath上的某个位置来安装 - 例如。在/Users/Sam/Library/Python/2.5/site-packages中,如果错误消息中提到的路径是准确的。

No need for fussy and error-prone installers which just overcomplicate the issue.

不需要繁琐且容易出错的安装程序,这些安装程序只会使问题过于复杂。

#2


The configuration file .pydstutils.cfg has a syntax error.

配置文件.pydstutils.cfg有语法错误。

#3


Try to add the line at the top of ~/.pydistutils.cfg:

尝试添加〜/ .pydistutils.cfg顶部的行:

[easy_install]