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.エラーに対する対処
- wheelが無い。
$ pip install wheel
- 開発環境(gcc)が無い。
$ sudo apt install build-essential
- python3-devが無い。
$ sudo apt install python3-dev
- Twistedが無い。
$ pip install Twisted
5.ようやくscrapy
install.py
$ pip install scrapy
...
Installing collected packages: scrapy
Successfully installed scrapy-1.5.1
以上です。