使用pip安裝Scrapy出錯

安裝Scrapy出錯

安裝

使用pip安裝(Ubuntu)

# 安裝pip
sudo apt install python-pip # python2
sudo apt install python3-pip # python3
# python3
sudo pip3 install Scrapy
# python2
sudo pip install Scrapy

錯誤

cryptography安裝出錯

使用pip安裝Scrapy時:linux

...
...
Requirement already satisfied: pycparser in /usr/local/lib/python3.5/dist-packages (from cffi>=1.4.1->cryptography>=1.3.4->pyOpenSSL->Scrapy)
Installing collected packages: cryptography, pyOpenSSL, service-identity, Scrapy
  Found existing installation: cryptography 1.2.3
    Uninstalling cryptography-1.2.3:
      Successfully uninstalled cryptography-1.2.3
  Running setup.py install for cryptography ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-cye1ome_/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-q_y00_ho-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.5
    creating build/lib.linux-x86_64-3.5/cryptography
    copying src/cryptography/exceptions.py -> build/lib.linux-x86_64-3.5/cryptography
    copying src/cryptography/__init__.py -> build/lib.linux-x86_64-3.5/cryptography
    copying src/cryptography/fernet.py -> build/lib.linux-x86_64-3.5/cryptography
...
...

解決方法

點擊查看原文shell

可能的緣由: 缺乏依賴庫.ubuntu

for Ubuntu

python2scrapy

sudo apt-get install build-essential libssl-dev libffi-dev python-devide

python3ui

sudo apt-get install build-essential libssl-dev libffi-dev python3-devcode

相關文章
相關標籤/搜索