解决方案
export PYTHONPATH=项目路径
解决方案
设置动态USER-AGENT
安装scrapy-fake-useragent模块
在settings.py中添加配置
DOWNLOADER_MIDDLEWARES = {
'scrapy.downloadermiddlewares.useragent.UserAgentMiddleware':None,# 关闭默认方法
'scrapy_fake_useragent.middleware.RandomUserAgentMiddleware':400,# 开启
}
他的作用主要是设置下载的等待时间,下载等待时间长,不能满足段时间大规模抓取的要求,太短则大大增加了被ban的几率
DOWNLOAD_DELAY = 3
COOKIES_ENABLES=False
解决方案
重新编译Python3并安装,进入到Python解压目录执行命令
./configure --prefix=/usr/local/python3/ --enable-shared
make && make install
解决方案
yum -y install openssl openssl-devel
重新编译安装python
bs4.FeatureNotFound: Couldn’t find a tree builder with the features you requested: lxml. Do you need to install a parser library?
解决方案
pip3 install lxml==4.5.0
报错error: command ‘aarch64-linux-gnu-gcc’ failed with exit status 1
解决方案
配置/etc/apt/source.list,见【常见问题总结】=>【国产操作系统】
apt-get update
apt-get install python3.5-dev
pip install 模块名称
error:Unable to find vcvarsall.bat
解决方案
https://www.microsoft.com/zh-CN/download/details.aspx?id=53840
下拉选择语言选择中文版本
解决方案
yum -y install readline-devel
重新./configure,make,make install
解决方案
解决方案
解决方案
解决方案
ln -s libstdc++.so.6.0.26 /usr/lib64/libstdc++.so.6
strings /usr/lib64/libstdc++.so.6|grep CXXABI
可以CXXABI_1.3.8即可ExternalError: CUDA error(100), no CUDA-capable device is detected.
[Hint: ‘cudaErrorNoDevice’. This indicates that no CUDA-capable devices were detected by the installed CUDA driver. ] (at …\paddle\fluid\platform\gpu_info.cc:108)
[operator < fill_constant > error]
解决方案
import os
os.environ["CUDA_VISIBLE_DEVICES"] = '0' #一定要加在文件的最顶部,再引入其他的深度学习库!
import paddle
ModuleNotFoundError: No module named ‘setuptools_rust‘
解决方案
pip3 install -U pip setuptools
ModuleNotFoundError: No module named ‘skbuild‘
解决方案
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple scikit-build
ModuleNotFoundError: No module named ‘_bz2’
解决方案
yum install -y bzip2-devel
# 重新编译python,在安装
ImportError: No module named _ssl
解决方案
yum install openssl-devel -y
# 重新编译python,在安装
ModuleNotFoundError: No module named ‘_lzma’
解决方案
yum install xz-devel
yum install python-backports-lzma
pip install backports.lzma
“/lib64/libc.so.6: version `GLIBC_2.18’ not found (required by /lib64/libstdc++.so.6)”
解决方案
curl -O http://ftp.gnu.org/gnu/glibc/glibc-2.23.tar.gz
tar zxf glibc-2.23.tar.gz
cd glibc-2.18/
mkdir build
cd build/
../configure --prefix=/usr
make -j2
make install
ldd --version
# 如果遇到报错:gawk: error while loading shared libraries: /lib64/libm.so.6: invalid ELF header