gpt4 book ai didi

python - 如何在linux机器上安装Scrapy

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:59:46 27 4
gpt4 key购买 nike

我已经在我的机器上安装了 python2.7。然后我尝试使用以下命令安装 scrapy,但它抛出了一些异常。

root@boss[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

如何解决这个问题......

最佳答案

也许你需要在你的python2.7安装中安装pip:

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

如果你最终有多个 pip 命令,你可以像这样从 python2.7 调用一个

python2.7 -m pip install scrapy

关于python - 如何在linux机器上安装Scrapy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21506899/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com