Installation of Pandas fails on Ubuntu 12.04 - python

As per the Pandas community page (http://pandas.pydata.org/community.html), I am posting here first...
I am trying to install Pandas using pip, inside a virtual environment on a vanilla remote server running Ubuntu 12.04.3 (64bit). I have already installed the usual suspects (python-dev (2.7), numpy, scipy). Pandas does not get installed and I am not sure exactly what to change or add to ensure this happens.
I have seen other references (not with the same error) implying that memory may be an issue; the remote server (Digital Ocean droplet) only has 512MB.
The tail of the pip error log is shown below:
gcc: internal compiler error: Killed (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
error: command 'gcc' failed with exit status 4
----------------------------------------
Command /srv/tp/venv/bin/python -c "import setuptools;__file__='/srv/tp/venv/build/pandas/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-0bOHrG-record/install-record.txt --install-headers /srv/tp/venv/include/site/python2.7 failed with error code 1 in /srv/tp/venv/build/pandas
Exception information:
Traceback (most recent call last):
File "/srv/tp/venv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/basecommand.py", line 104, in main
status = self.run(options, args)
File "/srv/tp/venv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/commands/install.py", line 250, in run
requirement_set.install(install_options, global_options)
File "/srv/tp/venv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 1133, in install
requirement.install(install_options, global_options)
File "/srv/tp/venv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 577, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/srv/tp/venv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/__init__.py", line 256, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /srv/tp/venv/bin/python -c "import setuptools;__file__='/srv/tp/venv/build/pandas/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-0bOHrG-record/install-record.txt --install-headers /srv/tp/venv/include/site/python2.7 failed with error code 1 in /srv/tp/venv/build/pandas

I was having the same problem and error on ubuntu and then created a swapfile and it was solved! A tutorial can be found in the link below but in short:
sudo dd if=/dev/zero of=/swapfile bs=1024 count=524288
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04
After the swap file was created I restarted the server, typed pip install pandas and it finally worked.

The most secure way though is just: sudo apt-get install python-pandas

Probably it's out of memory error. At the top of you log, I can see gcc exit with code error 4. When I google it I saw a stackoverflow thread: Installing lxml with pip in virtualenv Ubuntu 12.10 error: command 'gcc' failed with exit status 4 .

Related

Installation error for language_check in python 2.7

I have tried to install language_check library in Python 2.7 by using...
pip install language_check
and...
pip install language_check --upgrade
In both cases, I get the following error...
Collecting language-check
Using cached language-check-0.8.tar.gz
Installing collected packages: language-check
Running setup.py install for language-check
Complete output from command "C:\Users\Gaurav M\Anaconda\python.exe" -c "import setuptools, tokenize;__file__='c:\\users\\gaurav~1\\appdata\\local\\temp\\pip-build-ew9qcy\\language-check\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\gaurav~1\appdata\local\temp\pip-b0zy9n-record\install-record.txt --single-version-externally-managed --compile:
Downloading 'LanguageTool-3.2.zip' (87.3 MiB)...
100%
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\gaurav~1\appdata\local\temp\pip-build-ew9qcy\language-check\setup.py", line 597, in <module>
sys.exit(main())
File "c:\users\gaurav~1\appdata\local\temp\pip-build-ew9qcy\language-check\setup.py", line 592, in main
run_setup_hooks(config)
File "c:\users\gaurav~1\appdata\local\temp\pip-build-ew9qcy\language-check\setup.py", line 561, in run_setup_hooks
language_tool_hook(config)
File "c:\users\gaurav~1\appdata\local\temp\pip-build-ew9qcy\language-check\setup.py", line 586, in language_tool_hook
download_lt()
File "download_lt.py", line 158, in download_lt
os.path.join(PACKAGE_PATH, dirname))
WindowsError: [Error 5] Access is denied
----------------------------------------
Command ""C:\Users\Gaurav M\Anaconda\python.exe" -c "import setuptools, tokenize;__file__='c:\\users\\gaurav~1\\appdata\\local\\temp\\pip-build-ew9qcy\\language-check\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\gaurav~1\appdata\local\temp\pip-b0zy9n-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\gaurav~1\appdata\local\temp\pip-build-ew9qcy\language-check
I also tried doing...
easy_install language_check
and that throws a different error...
Downloading https://pypi.python.org/packages/05/2e/471a9104b0fe7bb404de6d79e2fdd0c41ad08b87a16cbb4c8c5c9300a608/language-check-0.8.tar.gz#md5=8b4e3aa5e77bff1e33d3312a6dae870b
Processing language-check-0.8.tar.gz
Writing c:\users\gaurav~1\appdata\local\temp\easy_install-qkjgfj\language-check-0.8\setup.cfg
Running language-check-0.8\setup.py -q bdist_egg --dist-dir c:\users\gaurav~1\appdata\local\temp\easy_install-qkjgfj\language-check-0.8\egg-dist-tmp-py6mda
Downloading 'LanguageTool-3.2.zip' (87.3 MiB)...
100%
error: [Error 145] The directory is not empty <built-in function rmdir> c:\users\gaurav~1\appdata\local\temp\easy_install-qkjgfj\language-check-0.8\language_check\LanguageTool-3.2\org\languagetool\rules\uk
How do I install language_check in this case?
I check the sources of the file download_lt.py (github language_check).
It appears that the error occurs when you try to move the folder language_check/LanguageTool-X.Y with the command os.rename() from your TemporaryFile to your Anaconda Lib folder.
So far, #Orions is right, it is a permission problem.
Firstly, you should check your folder permission:
Go to your Local folder (should be C:\Users\Gaurav M\AppData\Local)
Right-click on Temp folder on select properties
Go to Security tab and Edit and Add your name if it doesn't appear under Group or user names.
Repeat the operation for your Anaconda folder. (should be C:\Users\Gaurav M\Anaconda)
Secondly, you can try:
pip install --user language_check
But the pip --user option install the package only for the user.
Install to the Python user install directory for your platform. Typically ~/.local/, or %APPDATA%Python on Windows. (See the Python documentation for site.USER_BASE for full details.)
Last but not least,
I presume you are using cmd or powershellas Command-line interpreter.
In my opinion, using cygwin on Windows makes a lot of things easier. Although It could be painful to configure, I would recommend a pre-configure cygwin solution like Babun.
Good luck!

Compiling Cx-Freeze under Ubuntu

For the entire day I have been attempting to compile cx-Freeze under Ubuntu 14.04 and had no luck. So I gave up and decided to ask experts here.
What I have
Ubuntu 14.04
Python 3.4
python-dev, python3-dev, python3.4-dev installed (I know this common issue)
Sources of cx-Freeze 4.3.3
I tried two ways:
install from the sources
install by pip
Install from the sources
sudo python3 setup.py install
What I got
a lot of
MyPath/cx_Freeze-4.3.3/source/bases/Console.c:24: undefined reference to `PyErr_Print'
MyPath/cx_Freeze-4.3.3/source/bases/Console.c:24: undefined reference to `Py_FatalError'
and then
collect2: error: ld returned 1 exit status
error: command 'i686-linux-gnu-gcc' failed with exit status 1
Install by pip
sudo pip3 install cx-Freeze
What I got
collect2: error: ld returned 1 exit status
error: command 'i686-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/cx-Freeze/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-c954v7x6-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/cx-Freeze
Storing debug log for failure in /home/grimel/.pip/pip.log
and in pip.log
Exception information:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/lib/python3/dist-packages/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/lib/python3/dist-packages/pip/req.py", line 706, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/usr/lib/python3/dist-packages/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/cx-Freeze/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-c954v7x6-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/cx-Freeze
So, I expect you to help me with this issue and gonna be very thankful:)
In setup.py string
if not vars.get("Py_ENABLE_SHARED", 0):
replace by
if True:
Thanks to Thomas K
From cx_freeze/issues
Download
You need to download the source code
For python 3.3 and 3.4:
sudo apt-get install python3-dev
sudo apt-get install libssl-dev
Open setup.py and change the line
if not vars.get("Py_ENABLE_SHARED", 0):
to
if True:
python3 setup.py build
sudo python3 setup.py install
For python 2.7:
sudo apt-get install python-dev
sudo apt-get install libssl-dev
Open setup.py and change the line
if not vars.get("Py_ENABLE_SHARED", 0):
to
if True:
python setup.py build
sudo python setup.py install
GriMel's answer worked for me. Until cx_freeze releases an update for this, I'm including a set of steps that you can do to get this working using GriMels' solution.
# create and activate virtualenv (as desired)
virtualenv envs/test_cxfreeze
. ./envs/test_cxfreeze/bin/activate
# download cxfreeze; do not install yet
mkdir src/
pip install --download=./src/ cx-freeze
tar zxvf ./src/cx_Freeze-4.3.4.tar.gz -C ./src/
# fix bug in setup.py
vim src/cx_Freeze-4.3.4/setup.py
84c84
< if True:
---
> if not vars.get("Py_ENABLE_SHARED", 0):
# install cxfreeze
pip install ./src/cx_Freeze-4.3.4/
I've also opened up a bitbucket issue with what appears to be the source repo.
https://bitbucket.org/anthony_tuininga/cx_freeze/issues/153/cx_freeze-434-compile-error-on-ubuntu-1404
Looks like you might have a typo
change
sudo pip3 install cx-Freeze
to
sudo pip3 install cx_Freeze

Mavericks Python 3.4 pip install error

Trying to install pip and I get this error
following https://github.com/Homebrew/homebrew/wiki/Homebrew-and-Python
Sumners-MacBook-Pro:Downloads Sumner$ python get-pip.py
Downloading/unpacking pip
Downloading pip-1.5.4-py2.py3-none-any.whl (1.2MB): 1.2MB downloaded
Installing collected packages: pip
Cleaning up...
Exception:
Traceback (most recent call last):
File "/var/folders/l6/0vw_83pn3kq52x2wjhkmns2r0000gn/T/tmpAovvNy/pip.zip/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/var/folders/l6/0vw_83pn3kq52x2wjhkmns2r0000gn/T/tmpAovvNy/pip.zip/pip/commands/install.py", line 279, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/var/folders/l6/0vw_83pn3kq52x2wjhkmns2r0000gn/T/tmpAovvNy/pip.zip/pip/req.py", line 1380, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/var/folders/l6/0vw_83pn3kq52x2wjhkmns2r0000gn/T/tmpAovvNy/pip.zip/pip/req.py", line 664, in install
self.move_wheel_files(self.source_dir, root=root)
File "/var/folders/l6/0vw_83pn3kq52x2wjhkmns2r0000gn/T/tmpAovvNy/pip.zip/pip/req.py", line 894, in move_wheel_files
pycompile=self.pycompile,
File "/var/folders/l6/0vw_83pn3kq52x2wjhkmns2r0000gn/T/tmpAovvNy/pip.zip/pip/wheel.py", line 202, in move_wheel_files
clobber(source, lib_dir, True)
File "/var/folders/l6/0vw_83pn3kq52x2wjhkmns2r0000gn/T/tmpAovvNy/pip.zip/pip/wheel.py", line 189, in clobber
os.makedirs(destsubdir)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip'
Storing debug log for failure in /Users/Sumner/Library/Logs/pip.log
As I cannot comment due to my lack of 50 reputation, I will 'comment' in an answer.
Although you may be admin, you still have to type sudo before you do anything...
To check if your account has admin privileges, type sudo bash in your terminal, and if it says myusername is not in the sudoers file. This incident will be reported., then you aren't an admin.
Here is a short demonstration of the above:
ajs-iMac-5:~ aj8uppal$ sudo bash
Password:
bash-3.2#
bash-3.2# exit
ajs-iMac-5:~ aj8uppal$ pip install colorama
Downloading/unpacking colorama
Downloading colorama-0.2.7.tar.gz
Running setup.py (path:/private/var/folders/f7/r3hxg4tx3859tjpb0n_q9hnw0000gp/T/pip_build_aj8uppal/colorama/setup.py) egg_info for package colorama
Installing collected packages: colorama
Running setup.py install for colorama
error: could not create '/Library/Python/2.7/site-packages/colorama': Permission denied
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/f7/r3hxg4tx3859tjpb0n_q9hnw0000gp/T/pip_build_aj8uppal/colorama/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/f7/r3hxg4tx3859tjpb0n_q9hnw0000gp/T/pip-geh1_f-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/colorama
copying colorama/__init__.py -> build/lib/colorama
copying colorama/ansi.py -> build/lib/colorama
copying colorama/ansitowin32.py -> build/lib/colorama
copying colorama/initialise.py -> build/lib/colorama
copying colorama/win32.py -> build/lib/colorama
copying colorama/winterm.py -> build/lib/colorama
running install_lib
creating /Library/Python/2.7/site-packages/colorama
THE ERROR: error: could not create '/Library/Python/2.7/site-packages/colorama': Permission denied
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/f7/r3hxg4tx3859tjpb0n_q9hnw0000gp/T/pip_build_aj8uppal/colorama/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/f7/r3hxg4tx3859tjpb0n_q9hnw0000gp/T/pip-geh1_f-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/f7/r3hxg4tx3859tjpb0n_q9hnw0000gp/T/pip_build_aj8uppal/colorama
Storing debug log for failure in /var/folders/f7/r3hxg4tx3859tjpb0n_q9hnw0000gp/T/tmptJWePV
ajs-iMac-5:~ aj8uppal$ sudo pip install colorama
Downloading/unpacking colorama
Downloading colorama-0.2.7.tar.gz
Running setup.py (path:/private/tmp/pip_build_root/colorama/setup.py) egg_info for package colorama
Installing collected packages: colorama
Running setup.py install for colorama
Successfully installed colorama
Cleaning up...
ajs-iMac-5:~ aj8uppal$
Or you could combine the first two steps and head into the third one, and if it raises an error when you type in sudo, then you aren't an admin.
Here you go! You need admin privilege to do it. Type sudo python get-pip.py and enter the admin password.
It will automatically install pip-6.1.1 for you.
This appears to be because the default version of Python, shipped with the OSX operating system, requires sudo permissions to run in a few places.
In general you probably shouldn't be developing with the operating system version of python, and I personally prefer never to sudo install anything that doesn't obviously need root access.
Instead of using the default version, install a user-specific Python installation with Homebrew.
brew install python
And then you get the pip command properly installed for free!

Cannot install lxml 3.3.3 on OSX 10.9 with buildout

Have seen numerous related posts but not had any luck getting this to work. Log shows:
We have no distributions for lxml that satisfies 'lxml'.
Getting distribution for 'lxml'.
Running easy_install:
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python" "-c" "from setuptools.command.easy_install import main; main()" "-mZUNxd" "/Users/brad/Development/python/eggs/tmpLpoVC3" "-q" "/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/tmpZx0t7aget_dist/lxml-3.3.3.tar.gz"
path=/Users/brad/Development/python/eggs/setuptools-0.7.2-py2.7.egg
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
In file included from src/lxml/lxml.etree.c:346:
/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/easy_install-XSC3pm/lxml-3.3.3/src/lxml/includes/etree_defs.h:9:10: fatal error: 'libxml/xmlversion.h' file not found
#include "libxml/xmlversion.h"
^
1 error generated.
error: Setup script exited with error: command '/usr/bin/clang' failed with exit status 1Building lxml version 3.3.3.
Building without Cython.
ERROR: /bin/sh: xslt-config: command not found
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
An error occurred when trying to install lxml 3.3.3. Look above this message for any errors that were output by easy_install.
While:
Installing pydev.
Getting distribution for 'lxml'.
Error: Couldn't install: lxml 3.3.3
Tried answers from Cannot install Lxml on Mac os x 10.9.
xcode-select --install worked initially until an XCode upgrade to 10.5. Then hasn't worked since (even after retrying this line). Now I always get Can't install the software because it is not currently available from the Software Update server
Tried this STATIC_DEPS=true pip install lxml. It installed with error:
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip-4lSNM3-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad/lxml
Storing debug log for failure in /Users/brad/Library/Logs/pip.log
That log file ends with:
Cleaning up...
Removing temporary dir /private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip-4lSNM3-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad/lxml
Exception information:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/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-1.5.4-py2.7.egg/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg/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-1.5.4-py2.7.egg/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip-4lSNM3-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/3c/mdys56lx2wbf9rjlmqy4nhy40000gn/T/pip_build_brad/lxml
Creating the symlink (https://stackoverflow.com/a/19549645/1399659) didn't help either.
Ideas appreciated, thanks
Ok, so coming back to this with fresh eyes, again, managed to resolve it.
The error clang: error: unknown argument: '-mno-fused-madd' during the pip install lxml above was the clincher. I'd spotted it and https://stackoverflow.com/a/22578811/1399659, but couldn't get another python version to work. Had tried MacPorts and Homebrew.
Finally a tip from https://stackoverflow.com/a/17439319/1399659 led me to removing macport's lxml and the system-installed pip. Then installing HomeBrew's python over fresh (with occasional forced linking), let me use it's installed pip to run bog-standard pip install lxml
Now running Homebrew's python 2.7.6 and pip, which was used to install lxml 3.3.3

Repeatedly failing to install scrapy and lxml

I'd previously used Anaconda to handle python, but I'm and start working with virtual environments.
I set up virtualenv and virtualenvwrapper, and have been trying to add modules, specifically scrapy and lxml, for a project I want to try.
Each time I pip install, I hit an error.
For scrapy:
File "/home/philip/Envs/venv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1003, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
---------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/philip/Envs/venv/build/cryptography
Storing debug log for failure in /home/philip/.pip/pip.log
For lxml:
In file included from src/lxml/lxml.etree.c:346:0:
/home/philip/Envs/venv/build/lxml/src/lxml/includes/etree_defs.h:9:31: fatal error: libxml/xmlversion.h: No such file or directory
include "libxml/xmlversion.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Cleaning up... Command /home/philip/Envs/venv/bin/python -c "import setuptools, tokenize;__file__='/home/philip/Envs/venv/build/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-zIsPdl-record/install-record.txt
--single-version-externally-managed --compile --install-headers /home/philip/Envs/venv/include/site/python2.7 failed with error code 1 in /home/philip/Envs/venv/build/lxml Storing debug log for failure in /home/philip/.pip/pip.log
I tried to install it following scrapy's documentation, but scrapy was still not listed when I called for python's installed modules.
Any ideas? Thanks--really appreciate it!
I'm on Ubuntu 13.10 if it matters. Other modules I've tried have installed fine (though I've only gone for a handful).
I had the same problem in Ubuntu 14.04. I've solved it with the instructions of the page linked by #jdigital and the openssl-dev library pointed by #user3115915. Just to help others:
sudo apt-get install libxslt1-dev libxslt1.1 libxml2-dev libxml2 libssl-dev
sudo pip install scrapy
In my case, I solve the problem installing all the libraries that Manuel mention plus the extra library: libffi-dev
https://askubuntu.com/questions/499714/error-installing-scrapy-in-virtualenv-using-pip
Updated from #Mario C. and #Manuel,
Here is commands:
sudo apt-get install libxslt1-dev libxslt1.1 libxml2-dev libxml2 libssl-dev libffi-dev
sudo pip install scrapy

Categories