简体   繁体   English

Scrapy 导入错误:没有名为 Scrapy 的模块

[英]Scrapy Import Error: No Module named Scrapy

I installed scrapy using the command line我使用命令行安装了scrapy

pip install git+https://github.com/scrapy/scrapy@master --no-dependencies --upgrade

once installed, I tried importing scrapy in one of my python projects but an error arises saying:安装后,我尝试在我的一个 python 项目中导入scrapy,但出现错误:

Traceback (most recent call last):
File "C:\Users\Lenovo\Desktop\Linkedin\script.py", line 7, in <module>
from scrapy import Selector
ImportError: No module named scrapy
[Finished in 0.983s]

What shall I do?我该怎么办? Can't find a correct solution on Google yet!在谷歌上还没有找到正确的解决方案!

Could you use:你能不能用:

pip install Scrapy

source来源

import scrapy

print(scrapy.__version__)

output:输出:

1.8.0

when I run:当我运行时:

from scrapy import Selector

I get no error我没有错误

#To install Scrapy using conda run: #使用 conda 安装 Scrapy 运行:

conda install -c conda-forge scrapy conda install -c conda-forge scrapy

#if you're already familiar with installation of Python packages, you can install Scrapy #如果你已经熟悉Python包的安装,你可以安装Scrapy

pip install Scrapy pip 安装 Scrapy

尝试使用 conda 安装它,然后设置你的 python 环境路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM