I had this problem and I did this:
installed all xcode (2.8GB) from the Apple store.
to verify that the installation completed successfully: open a terminal and enter
xcode-select -p
you should get something like this:
/Applications/Xcode.app/Contents/Developer
Now you need to install the command line tools. try to enter gcc on the terminal, then there are two possibilities: either you get a window asking you to install the tools, and you need to click install , or you get an error message.
if you get an error then donβt worry, just try installing the tools using this xcode-select --install
after that restart mac and then install lxml again as follows:
pip install lxml
then try running scrapy again
if you encounter any other error in any other library, just reinstall it with easy_install and NOT using pip
Paolo rlang
source share