By Andy H
When starting this tutorial on using scrapy to crawl a site on a fresh Ubuntu 16.04 droplet with only python installed via apt install python python-pip - I ran the scrapy install command:
pip install scrapy
and got the following errors:
Failed building wheel for cryptography
and
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-uMrPxH/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-w7GcS0-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-uMrPxH/cryptography/
I was missing some vital cryptography libs that scrapy depends on, to install them I ran:
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
pip install cryptography
once that executed I could install scrapy with a pip install scrapy and get on with the excellent tutorial!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
For some reasons, it doesn’t work on ubuntu 14. Any more solutions?
Exact error is
error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1
----------------------------------------
Command “/home/work/Workspace/venv/tmtext/bin/python2.7 -u -c “import setuptools, tokenize;file=‘/tmp/pip-install-12TB2u/cryptography/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-record-dfm5Vh/install-record.txt --single-version-externally-managed --compile --install-headers /home/work/Workspace/venv/tmtext/include/site/python2.7/cryptography” failed with error code 1 in /tmp/pip-install-12TB2u/cryptography/
Thanks for your comment, I added
- sudo apt-get install build-essential libssl-dev libffi-dev python-dev
to the local Ubuntu 16.04 set-up tutorial in case others run into this issue.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.