当前位置: 动力学知识库 > 问答 > 编程问答 >

python - How to install Scrapy in linux Machine

问题描述:

I am already install the python2.7 in my machine. Then i tried to install scrapy by using following commands but its throwing some exceptions.

[email protected][elcot]#pip install scrapy

Requirement already satisfied (use --upgrade to upgrade): scrapy in /usr/local/lib/python2.7/site-packages/Scrapy-0.22.0-py2.7.egg

Downloading/unpacking Twisted>=10.0.0 (from scrapy)

Downloading Twisted-13.2.0.tar.bz2 (2.7MB): 2.7MB downloaded

Cleaning up...

Exception:

Traceback (most recent call last):

File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main

status = self.run(options, args)

File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 274, in run

requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)

File "/usr/local/lib/python2.7/site-packages/pip/req.py", line 1173, in prepare_files

self.unpack_url(url, location, self.is_download)

File "/usr/local/lib/python2.7/site-packages/pip/req.py", line 1320, in unpack_url

retval = unpack_http_url(link, location, self.download_cache, self.download_dir, self.session)

File "/usr/local/lib/python2.7/site-packages/pip/download.py", line 587, in unpack_http_url

unpack_file(temp_location, location, content_type, link)

File "/usr/local/lib/python2.7/site-packages/pip/util.py", line 625, in unpack_file

untar_file(filename, location)

File "/usr/local/lib/python2.7/site-packages/pip/util.py", line 543, in untar_file

tar = tarfile.open(filename, mode)

File "/usr/local/lib/python2.7/tarfile.py", line 1678, in open

return func(name, filemode, fileobj, **kwargs)

File "/usr/local/lib/python2.7/tarfile.py", line 1744, in bz2open

raise CompressionError("bz2 module is not available")

CompressionError: bz2 module is not available

Storing debug log for failure in /root/.pip/pip.log

How to solve this.......

网友答案:

Perhaps you need to install pip in your python2.7 installation:

wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
python2.7 get-pip.py

If you end up with multiple pip commands, you can call the one from python2.7 like this

python2.7 -m pip install scrapy
网友答案:

Try to install by easy install.

easy_install scrapy.

This will be helpful for you.

网友答案:

Try creating a symlink ln -s /usr/local/bin/python2.7 /usr/bin/python.

分享给朋友:
您可能感兴趣的文章:
随机阅读: