oneface 发表于 2021-1-5 13:50:35

python3.9 scrapy安装问题

在https://www.lfd.uci.edu/~gohlke/pythonlibs下载好文件后
一个一个pip进去
安装完后运行scrapy报错

C:\Users\Administrator>scrapy
Traceback (most recent call last):
File "f:\python\lib\runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
File "f:\python\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
File "F:\python\Scripts\scrapy.exe\__main__.py", line 4, in <module>
File "f:\python\lib\site-packages\scrapy\__init__.py", line 12, in <module>
    from scrapy.spiders import Spider
File "f:\python\lib\site-packages\scrapy\spiders\__init__.py", line 11, in <module>
    from scrapy.http import Request
File "f:\python\lib\site-packages\scrapy\http\__init__.py", line 11, in <module>
    from scrapy.http.request.form import FormRequest
File "f:\python\lib\site-packages\scrapy\http\request\form.py", line 10, in <module>
    import lxml.html
File "f:\python\lib\site-packages\lxml\html\__init__.py", line 53, in <module>
    from .. import etree
ImportError: DLL load failed while importing etree: 找不到指定的程序。

反复卸载重装 lxml和scrapy 都没有解决

一个账号 发表于 2021-1-8 19:49:20

在 CMD 输入这个:

pip uninstall scrapy & pip install scrapy

oneface 发表于 2021-1-9 11:10:27

一个账号 发表于 2021-1-8 19:49
在 CMD 输入这个:

没用

oneface 发表于 2021-1-9 11:10:57

一个账号 发表于 2021-1-8 19:49
在 CMD 输入这个:

报一样的错

yukari123 发表于 2023-1-25 16:39:16

请问cmd在哪找

chinajz 发表于 2023-1-25 20:42:04

本帖最后由 chinajz 于 2023-1-25 21:05 编辑

pip3 install--force-reinstall scrapy -i http://pypi.douban.com/simple
#或者:
pip3 install--force-reinstall scrapy -i https://mirrors.aliyun.com/pypi/simple/

chinajz 发表于 2023-1-25 20:43:48

~ % scrapy
Scrapy 2.7.1 - no active project

Usage:
scrapy <command>

Available commands:
bench         Run quick benchmark test
commands      
fetch         Fetch a URL using the Scrapy downloader
genspider   Generate new spider using pre-defined templates
runspider   Run a self-contained spider (without creating a project)
settings      Get settings values
shell         Interactive scraping console
startprojectCreate new project
version       Print Scrapy version
view          Open URL in browser, as seen by Scrapy

[ more ]      More commands available when run from project directory

Use "scrapy <command> -h" to see more info about a command
页: [1]
查看完整版本: python3.9 scrapy安装问题