Cannot install scrapy


#1

If anyone tries to follow this tutorial they will get an error installing scrapy. Does anyone know why this is ? what changed in cloud9?

If you do
pip install scrapy

you will get

 ----------------------------------------

Cleaning up…
Command /usr/bin/python -c “import setuptools, tokenize;file=’/tmp/pip_build_ubuntu/Twisted/setup.py’;exec(compile(getattr(tokenize, ‘open’, open)(file).read().replace(’\r\n’, ‘\n’), file, ‘exec’))” install --record /tmp/pip-BibfAJ-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_ubuntu/Twisted
Storing debug log for failure in /tmp/tmpmkwT8a


#2

Try updating pip first and then re-try.


#3

I tried updating pip but I still get this error : ----------------------------------------
Cleaning up…
Command /usr/bin/python -c “import setuptools, tokenize;file=’/tmp/pip_build_ubuntu/Twisted/setup.py’;exec(compile(getattr(tokenize, ‘open’, open)(file).read().replace(’\r\n’, ‘\n’), file, ‘exec’))” install --record /tmp/pip-78qdr7-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_ubuntu/Twisted
Storing debug log for failure in /tmp/tmp8Ig4un


#4

I get the same error…


#5

Do you have disttools or setuptools installed?


#6

I didn’t figure it out but c9 customer support was able to. Here is
what they said

Hi, I tried following:

uninstall scrapy
reinstall scrapy
got error that python.h was not found, so installed
sudo apt-get install python-dev
installed twisted
installed
sudo apt-get install python-lxml
error on crypto things (solution here:
https://github.com/scrapy/scrapy/issues/1314)
then it worked. I will leave the terminal open.

It shows:

tyche:~/workspace $ scrapy startproject tutorial
New Scrapy project ‘tutorial’, using template directory
’/usr/local/lib/python2.7/dist-packages/scrapy/templates/project’,
created in:
/home/ubuntu/workspace/tutorial

You can start your first spider with:
cd tutorial
scrapy genspider example example.com

terminal history |
1 pip --version
2 sudo pip uninstall scrapy
3 sudo pip uninstall twisted
4 pip install scrapy --upgrade
5 sudo pip install scrapy --upgrade
6 sudo apt-get install python-dev
7 sudo pip install scrapy --upgrade
8 pip install twisted --upgrade
9 sudo pip install twisted --upgrade
10 scrapy startproject tutorial
11 sudo apt-get install python-lxml
12 scrapy startproject tutorial
13 sudo pip install --upgrade pip
14 sudo pip install --upgrade Scrapy
15 scrapy startproject tutorial