LoginSignup
3
0

More than 5 years have passed since last update.

scrapyのインストールでエラーになった際の対処法(Ubuntu18.04)

Last updated at Posted at 2018-12-12

1.この記事の目的

scrapyをubuntu 18.04にインストールしようとした所、少々エラーが発生したので、
その解決方法を共有することを目的とした投稿です。

error.py
error: invalid command 'bdist_wheel'##wheelが無い!

  ----------------------------------------
  Failed building wheel for PyDispatcher
  Running setup.py clean for PyDispatcher
  Running setup.py bdist_wheel for Twisted ... error
  Complete output from command /home/yoshida/pyProject/breadData/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-imm_816d/Twisted/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpsiymix5ypip-wheel- --python-tag cp36:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help

  error: invalid command 'bdist_wheel'

  ----------------------------------------
  Failed building wheel for Twisted#Twistedも無い!
  Running setup.py clean for Twisted
Failed to build PyDispatcher Twisted
Installing collected packages: cssselect, w3lib, parsel, PyDispatcher, queuelib, pyasn1, pyasn1-modules, service-identity, Twisted, scrapy
  Running setup.py install for PyDispatcher ... done
  Running setup.py install for Twisted ... error
    Complete output from command /home/yoshida/pyProject/breadData/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-imm_816d/Twisted/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-jlw00lig-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/yoshida/pyProject/breadData/include/site/python3.6/Twisted:

2.環境

ubuntu 18.04
再インストールしたばかりの状況です。

3.発生したエラー群まとめ

  • wheelが無い。
  • 開発環境(gcc)が無い。
  • python3-devが無い。
  • Twistedが無い。

4.エラーに対する対処

  1. wheelが無い。 $ pip install wheel
  2. 開発環境(gcc)が無い。 $ sudo apt install build-essential
  3. python3-devが無い。 $ sudo apt install python3-dev
  4. Twistedが無い。 $ pip install Twisted

5.ようやくscrapy

install.py
$ pip install scrapy 
...
Installing collected packages: scrapy
Successfully installed scrapy-1.5.1

以上です。

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0