首页 > Python > scrapyd-deploy时遇报错 ScrapyDeprecationWarning: Module `scrapy.utils.http` is deprecated, Please import from `w3lib.http` instead.
2020
07-03

scrapyd-deploy时遇报错 ScrapyDeprecationWarning: Module `scrapy.utils.http` is deprecated, Please import from `w3lib.http` instead.

在执行命令:scrapyd-deploy时遇报错:

/usr/local/bin/scrapyd-deploy:23: ScrapyDeprecationWarning: Module `scrapy.utils.http` is deprecated, Please import from `w3lib.http` instead.
from scrapy.utils.http import basic_auth_header
Error: no Scrapy project found in this location

 

#!d:\python37\python.exe

import sys
import os
import glob
import tempfile
import shutil
import time
from six.moves.urllib.request import (build_opener, install_opener,
                                      HTTPRedirectHandler as UrllibHTTPRedirectHandler,
                                      Request, urlopen)
from six.moves.urllib.error import HTTPError, URLError
import netrc
import json
from optparse import OptionParser
from six.moves.urllib.parse import urlparse, urljoin
from subprocess import Popen, PIPE, check_call

from w3lib.form import encode_multipart
import setuptools # not used in code but needed in runtime, don't remove!

from scrapy.utils.project import inside_project
#from scrapy.utils.http import basic_auth_header  #注释此行
from w3lib.http import basic_auth_header  #增加此行
from scrapy.utils.python import retry_on_eintr
from scrapy.utils.conf import get_config, closest_scrapy_cfg
 
 
 
............................

 

scrapyd-deploy时遇报错 ScrapyDeprecationWarning: Module `scrapy.utils.http` is deprecated, Please import from `w3lib.http` instead. - 第1张  | 技术人生

最后编辑:
作者:sunny5156
喜欢技术....

留下一个回复