Wednesday, 15 June 2011

python - Fail to install lxml using pip -



python - Fail to install lxml using pip -

this command used install lxml:

sudo pip install lxml

and got next message in cleaning stage:

cleaning up... command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-rufjfn-record/install-record.txt --single-version-externally-managed --compile failed error code 1 in /private/tmp/pip_build_root/lxml storing debug log failure in /users/georgejor/library/logs/pip.log

after that, got:

importerror: no module named lxml

please help. thanks!

the next output pip.log:

---------------------------------------- cleaning up... removing temporary dir /private/tmp/pip_build_root... command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-rufjfn-record/install-record.txt --single-version-externally-managed --compile failed error code 1 in /private/tmp/pip_build_root/lxml exception information: traceback (most recent phone call last): file "/library/python/2.7/site-packages/pip/basecommand.py", line 122, in main status = self.run(options, args) file "/library/python/2.7/site-packages/pip/commands/install.py", line 283, in run requirement_set.install(install_options, global_options, root=options.root_path) file "/library/python/2.7/site-packages/pip/req.py", line 1435, in install requirement.install(install_options, global_options, *args, **kwargs) file "/library/python/2.7/site-packages/pip/req.py", line 706, in install cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=false) file "/library/python/2.7/site-packages/pip/util.py", line 697, in call_subprocess % (command_desc, proc.returncode, cwd)) installationerror: command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-rufjfn-record/install-record.txt --single-version-externally-managed --compile failed error code 1 in /private/tmp/pip_build_root/lxml

just install these stuff :

sudo apt-get install libxml2-dev libxslt-dev python-dev python-setuptools

then seek 1 time again :

pip install lxml

python lxml

No comments:

Post a Comment