views:

701

answers:

3
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'

The same here as a picture: http://dl.getdropbox.com/u/175564/py.png

I am trying to install beautifulsoup.

The first two lines in ~/.pydistutils.cfg:

install_lib = ~/Library/Python/$py_version_short/site-packages
install_scripts = ~/bin
+2  A: 

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

Crashworks
How can I fix this syntax error?
Masi
+2  A: 

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

[easy_install]
J.F. Sebastian
It gives me this error: error: error in /Users/Sam/.pydistutils.cfg: command 'easy_install' has no such option 'install_lib'
Masi
@Masi: `[default]` might help. Or just rename `.pydistutils.cfg` as @Charles Duffy suggested.
J.F. Sebastian
Where can I find Charles Duffy's suggestion?
Masi
What do you mean with this: `[default]` might help?
Masi
Charles Duffy's suggestion is in comments to your question (click 'comments' under the question).
J.F. Sebastian
Replace '[easy_install]' by '[default]' (don't include the quote sign "'" in the actual file) at the first line in '~/.pydistutils.cfg'.
J.F. Sebastian
Just [install] would work...
jmanning2k
+3  A: 

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.

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

bobince