我正在尝试安装一个名为news-please
的Python包。此软件包已在PyPi和Github上。
当我按照Github页面上显示的pip install news-please
时,它会显示以下内容:
Collecting news-please
Using cached news-please-1.1.48.tar.gz
Collecting Scrapy>=1.1.0 (from news-please)
Using cached Scrapy-1.4.0-py2.py3-none-any.whl
Collecting PyMySQL>=0.7.9 (from news-please)
Using cached PyMySQL-0.7.11-py2.py3-none-any.whl
Collecting hjson>=1.5.8 (from news-please)
Using cached hjson-2.0.7.tar.gz
Collecting elasticsearch>=2.4 (from news-please)
Using cached elasticsearch-5.4.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade):
beautifulsoup4>=4.3.2 in c:\users\[my name]\anaconda3\lib\site-packages
(from news-please)
Collecting readability-lxml>=0.6.2 (from news-please)
Using cached readability-lxml-0.6.2.tar.gz
Collecting langdetect>=1.0.7 (from news-please)
Using cached langdetect-1.0.7.zip
Requirement already satisfied (use --upgrade to upgrade): python-
dateutil>=2.4.0 in c:\users\[my name]\anaconda3\lib\site-packages (from
news-please)
Requirement already satisfied (use --upgrade to upgrade): plac>=0.9.6 in
c:\users\[my name]\anaconda3\lib\site-packages (from news-please)
Collecting dotmap>=1.2.17 (from news-please)
Using cached dotmap-1.2.17.tar.gz
Collecting PyDispatcher>=2.0.5 (from news-please)
Using cached PyDispatcher-2.0.5.tar.gz
Collecting warcio>=1.3.3 (from news-please)
Using cached warcio-1.3.4-py2.py3-none-any.whl
Collecting ago>=0.0.9 (from news-please)
Using cached ago-0.0.9.tar.gz
Collecting newspaper3k (from news-please)
Using cached newspaper3k-0.2.2.tar.gz
Requirement already satisfied (use --upgrade to upgrade): pywin32>=220 in
c:\users\[my name]\anaconda3\lib\site-packages (from news-please)
Collecting lxml>=3.35 (from news-please)
Could not find a version that satisfies the requirement lxml>=3.35 (from
news-please) (from versions: 0.9, 0.9.1, 0.9.2, 1.0b0, 1.0, 1.0.1, 1.0.2,
1.0.3, 1.0.4, 1.1a0, 1.1b0, 1.1, 1.1.1, 1.1.2, 1.2, 1.2.1, 1.3b0, 1.3,
1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 2.0a1, 2.0a2, 2.0a3, 2.0a4, 2.0a5,
2.0a6, 2.0b1, 2.0b2, 2.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7,
2.0.8, 2.0.9, 2.0.10, 2.0.11, 2.1a1, 2.1b1, 2.1b2, 2.1b3, 2.1, 2.1.1,
2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.2a1, 2.2b1, 2.2b2, 2.2b3, 2.2b4, 2.2, 2.2.1,
2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.2.6, 2.2.7, 2.2.8, 2.3b1, 2.3, 2.3.1, 2.3.2,
2.3.3, 2.3.4, 2.3.5, 2.3.6, 3.0, 3.0.1, 3.0.2, 3.1b1, 3.1.0, 3.1.1, 3.1.2,
3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.3.0b1, 3.3.0b2, 3.3.0b3,
3.3.0b4, 3.3.0b5, 3.3.0, 3.3.1, 3.3.2, 3.3.3, 3.3.4, 3.3.5, 3.3.6, 3.4.0,
3.4.1, 3.4.2, 3.4.3, 3.4.4, 3.5.0b1, 3.5.0, 3.6.0, 3.6.1, 3.6.2, 3.6.3,
3.6.4, 3.7.0, 3.7.1, 3.7.2, 3.7.3, 3.8.0)
No matching distribution found for lxml>=3.35 (from news-please)
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip'
command.
现在问题在于它无法找到满足要求的版本lxml> = 3.35。
我已经有一个大于3.35的lxml版本。当我做'pip show lxml'时,它告诉我我当前的版本是3.8.0。
如何解决此问题?
答案 0 :(得分:0)
如果您已经满意these dependencies:
pywin32 >=220 ; sys_platform == 'win32'
lxml >=3.35 ; sys_platform == 'win32'
Scrapy>=1.1.0
PyMySQL>=0.7.9
hjson>=1.5.8
elasticsearch>=2.4
beautifulsoup4>=4.3.2
readability-lxml>=0.6.2
newspaper3k>=0.1.7 ; python_version >= '3.0'
newspaper>=0.0.9.8 ; python_version == '2.7'
langdetect>=1.0.7
python-dateutil>=2.4.0
plac>=0.9.6
future>=0.16.0 ; python_version == '2.7'
PyDispatcher>=2.0.5
dotmap>=1.2.17
warcio>=1.3.3
ago>=0.0.9
然后你可以使用
pip install --no-deps -U news-please
要有pip安装新闻 - 请不要依赖。
答案 1 :(得分:0)
有关如何在Windows上安装新闻娱乐的信息,可在文档中找到,例如https://github.com/fhamborg/news-please/wiki/user-guide#windows-systems
因此,您需要安装lxml和pywin32:
lxml:
Go to Christoph's Gohlke's Python page and download the compatible wheel for your system.
(32bit : "lxml-X.X.X-cp35-cp35m-win32.whl"; 64bit: "lxml-X.X.X-cp35-cp35m-win_amd64.whl")
Open the Windows console and navigate to your Python installation:
C:\Users\USERNAME>cd C:\Python35
Install the wheel with the following command:
C:\Python35> pip install lxml-X.X.X-cp35-cp35m-win32.whl
pywin32:
Download the latest build of pywin32.
Make sure you select correct version (matches Python version, 32bit/64bit)
Execute the installer