LoginSignup
9
9

More than 5 years have passed since last update.

古いsetuptoolsをアップグレード

Last updated at Posted at 2018-08-20

scrapyを触ってみたいのでサンプルコードを写経

Scrapy at a glance

setuptoolsが古そうだというのはわかる

$ sudo pip install Scrapy実行後
エラー文

RuntimeError: cryptography requires setuptools 18.5 or newer, please upgrade to a newer version of setuptools

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/cryptography
Storing debug log for failure in /home/ubuntu/.pip/pip.log

では、アップグレード、と

とりあえずその前にバージョン確認しようと$ setuptools --version と打ってみるが

bash: setuptools: command not found

いえ、この書き方が悪かったのかも知れない、それでもsetuptoolsは入っているようだからなんとか今のバージョンを確認したい、と検索して$ pip list を発見。pipでインストールしたパッケージの名前とバージョンを一覧で取得してくれました。

beautifulsoup4 (4.6.3)
chardet (2.2.1)
colorama (0.2.5)
decorator (3.4.0)
html5lib (0.999)
ipython (1.2.1)
matplotlib (1.3.1)
nose (1.3.1)
numpy (1.8.2)
Pillow (2.3.0)
pip (1.5.4)
pycurl (7.19.3)
pygobject (3.12.0)
pyparsing (2.0.1)
python-apt (0.9.3.5ubuntu2)
python-dateutil (2.0)
pytz (2012c)
requests (2.2.1)
scipy (0.13.3)
setuptools (3.3)
simplegeneric (0.8.1)
six (1.5.2)
tornado (3.1.1)
unattended-upgrades (0.1)
urllib3 (1.7.1)
wheel (0.24.0)

setuptools (3.3)とな。requires setuptools 18.5 or newerからするとかなり古いな:laughing:

バージョンが分かったところで$ sudo pip install ~のノリで$ sudo pip upgrade setuptools を実行した。

ERROR: unknown command "upgrade"

「upgradeじゃないのか:sob:」とひとしきり検索して$ sudo pip --upgrade setuptoolsを実行。すると親切なことに

Usage:   
  pip <command> [options]

no such option: --upgrade

わー! ありがとう:two_hearts: ということで$ sudo pip install setuptools --upgradeを実行し、pip list も実行。setuptools (40.1.0):sparkles:
image.png

さて、気を取り直して$ sudo pip install Scrapy。。。

9
9
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
9
9