Ubuntu 12.04LTS pythonbrew install 2.7.5でERROR: Failed to install setuptools.
distributeでエラーが発生した。
まずは環境から
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.3 LTS
Release: 12.04
Codename: precise
エラー状況
$ pythonbrew install 2.7.5
...........
ERROR: Failed to install setuptools. See /home/keisuke/.pythonbrew/log/build.log to see why.
Skip installation of setuptools.
# エラーログ確認
$ vim /home/keisuke/.pythonbrew/log/build.log
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.49.tar.gz
5772 Traceback (most recent call last):
5773 File "distribute_setup.py", line 556, in
5774 sys.exit(main())
5775 File "distribute_setup.py", line 552, in main
5776 tarball = download_setuptools(download_base=options.download_base)
5777 File "distribute_setup.py", line 211, in download_setuptools
5778 src = urlopen(url)
5779 File "/home/keisuke/.pythonbrew/pythons/Python-2.7.5/lib/python2.7/urllib2.py", line 127, in urlopen
5780 return _opener.open(url, data, timeout)
5781 File "/home/keisuke/.pythonbrew/pythons/Python-2.7.5/lib/python2.7/urllib2.py", line 410, in open
5782 response = meth(req, response)
5783 File "/home/keisuke/.pythonbrew/pythons/Python-2.7.5/lib/python2.7/urllib2.py", line 523, in http_response
5784 'http', request, response, code, msg, hdrs)
5785 File "/home/keisuke/.pythonbrew/pythons/Python-2.7.5/lib/python2.7/urllib2.py", line 442, in error
5786 result = self._call_chain(*args)
5787 File "/home/keisuke/.pythonbrew/pythons/Python-2.7.5/lib/python2.7/urllib2.py", line 382, in _call_chain
5788 result = func(*args)
5789 File "/home/keisuke/.pythonbrew/pythons/Python-2.7.5/lib/python2.7/urllib2.py", line 629, in http_error_302
5790 return self.parent.open(new, timeout=req.timeout)
5791 File "/home/keisuke/.pythonbrew/pythons/Python-2.7.5/lib/python2.7/urllib2.py", line 404, in open
5792 response = self._open(req, data)
5793 File "/home/keisuke/.pythonbrew/pythons/Python-2.7.5/lib/python2.7/urllib2.py", line 427, in _open
5794 'unknown_open', req)
5795 File "/home/keisuke/.pythonbrew/pythons/Python-2.7.5/lib/python2.7/urllib2.py", line 382, in _call_chain
5796 result = func(*args)
5797 File "/home/keisuke/.pythonbrew/pythons/Python-2.7.5/lib/python2.7/urllib2.py", line 1247, in unknown_open
5798 raise URLError('unknown url type: %s' % type)
5799 urllib2.URLError:
対応
いろいろインストールが必要らしい
$ sudo apt-get install build-essential
$ sudo apt-get install libncursesw5-dev
$ sudo apt-get install libreadline-gplv2-dev
$ sudo apt-get install libssl-dev
$ sudo apt-get install libgdbm-dev
$ sudo apt-get install libbz2-dev
$ sudo apt-get install libc6-dev
$ sudo apt-get install libsqlite3-dev
$ sudo apt-get install tk-dev
リトライ
pythonbrew install 2.7.5
Downloading Python-2.7.5.tgz as /home/keisuke/.pythonbrew/dists/Python-2.7.5.tgz
######################################################################## 100.0%
Extracting Python-2.7.5.tgz into /home/keisuke/.pythonbrew/build/Python-2.7.5
This could take a while. You can run the following command on another shell to track the status:
tail -f "/home/keisuke/.pythonbrew/log/build.log"
Installing Python-2.7.5 into /home/keisuke/.pythonbrew/pythons/Python-2.7.5
Downloading distribute_setup.py as /home/keisuke/.pythonbrew/dists/distribute_setup.py
######################################################################## 100.0%
Installing distribute into /home/keisuke/.pythonbrew/pythons/Python-2.7.5
Installing pip into /home/keisuke/.pythonbrew/pythons/Python-2.7.5
Installed Python-2.7.5 successfully. Run the following command to switch to Python-2.7.5.
pythonbrew switch 2.7.5
- 関連記事
-
- Vagrant boxセットアップ(1) Ubuntu12.04 LTS
- Ubuntu 12.04LTS pythonbrew install 2.7.5でERROR: Failed to install setuptools.
- Ubuntu 12.04LTS chkconfigで/sbin/insserv: No such file or directory