如何在Python3.6和CentOs上安装Twisted+Scrapy

2024-10-01 17:34:53 发布

您现在位置:Python中文网/ 问答频道 /正文

我在centos7上使用最新的Python和一个专用的virtualenv

(ENV) [luoc@study ~ ]$ lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.3.1611 (Core) 
Release:    7.3.1611
Codename:   Core

(ENV) [luoc@study ~ ]$ python --version
Python 3.6.0

当我安装scray时,错误

^{pr2}$

当我安装twisted independence时,错误

(ENV) [luoc@study ~ ]$ pip install Twisted
Collecting Twisted
  Could not find a version that satisfies the requirement Twisted (from versions: )
No matching distribution found for Twisted

(ENV) [luoc@study ~ ]$ pip install --verbose Twisted
Collecting Twisted
  1 location(s) to search for versions of Twisted:
  * https://pypi.python.org/simple/twisted/
  Getting page https://pypi.python.org/simple/twisted/
  Looking up "https://pypi.python.org/simple/twisted/" in the cache
  Current age based on date: 40208
  Freshness lifetime from max-age: 600
  Freshness lifetime from request max-age: 600
  The cached response is "stale" with no etag, purging
  Starting new HTTPS connection (1): pypi.python.org
  "GET /simple/twisted/ HTTP/1.1" 200 10196
  Updating cache with response from "https://pypi.python.org/simple/twisted/"
  Caching b/c date exists and max-age > 0
  Analyzing links from page https://pypi.python.org/simple/twisted/
Skipping link ...
Could not find a version that satisfies the requirement Twisted (from versions: )
Cleaning up...
No matching distribution found for Twisted
Exception information:
Traceback (most recent call last):
  File "/home/luoc/ENV/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/home/luoc/ENV/lib/python3.6/site-packages/pip/commands/install.py", line 335, in run
    wb.build(autobuilding=True)
  File "/home/luoc/ENV/lib/python3.6/site-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "/home/luoc/ENV/lib/python3.6/site-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/home/luoc/ENV/lib/python3.6/site-packages/pip/req/req_set.py", line 554, in _prepare_file
    require_hashes
  File "/home/luoc/ENV/lib/python3.6/site-packages/pip/req/req_install.py", line 278, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/home/luoc/ENV/lib/python3.6/site-packages/pip/index.py", line 514, in find_requirement
    'No matching distribution found for %s' % req
pip.exceptions.DistributionNotFound: No matching distribution found for Twisted

那么为什么不能在Python3.6上安装Twisted呢?我的环境有问题吗

Kmike suggested me to ask twisted's developer


Tags: pipinfrompyenvhomelibpackages
2条回答

我知道问题已经解决了,但我想帮助未来的用户。
我在Debian Strech上,刚刚安装了Python3.6,
如果您想自己安装crapy编译python3.6,请尝试运行

sudo apt-get install bzip2 libbz2-dev

之后,只需重新编译python3.6,它就可以工作了

你自己编译过Python3.6吗?在

您的python版本似乎是在没有bzip2支持的情况下编译的。这是同一问题的过去罚单:https://twistedmatrix.com/trac/ticket/8177

我建议使用Miniconda来拥有一个Python3.6环境,然后按照this instructions安装Scrapy。在

相关问题 更多 >

    热门问题