ERRORs

1.安装scrapy或者Twisted:fatal error: Python.h: 没有那个文件或目录

a:安装python3

2.python3.6的安装(3.7.x没有pip)

a:https://blog.csdn.net/libb_1122/article/details/78968462

并增加对pip3的软链接

ln -s /usr/local/bin/pip3.6  /usr/bin/pip

3.yum安装软件时出现:Yum:[Errno 5] [Errno 2] No such file or directory

有两个配置文件需要修改

/usr/bin/yum
/usr/libexec/urlgrabber-ext-down
分别将文件开头的声明路径改正确,改回2.7的版本

#! /usr/bin/env python2.7

4.centos安装 python-dev包提示No package python-dev available

修改为:
yum install python-devel

5.Delta RPMs disabled because /usr/bin/applydeltarpm not installed

yum provides '*applydeltarpm' #找出哪些包包含‘*applydeltarpm’
yum install deltarpm;

6.tar (child): lbzip2: Cannot exec: No such file or directory

yum -y install bzip2

7.Could not find a version that satisfies the requirement Twisted>=13.1.0 (from Scrapy) (from versions: )
No matching distribution found for Twisted>=13.1.0 (from Scrapy)

wget https://pypi.python.org/packages/source/T/Twisted/Twisted-18.7.0.tar.bz2
tar -xjvf Twisted-15.2.1.tar.bz2
cd Twisted-15.2.1
python3 setup.py install(python根据版本更换)

8.软硬链接

https://www.cnblogs.com/songgj/p/9115954.html

9.ModuleNotFoundError: No module named ‘twisted.persisted’

当前twisted的版本不支持当前python版本(3.x)
pip uninstall twisted (卸载当前的tuisted版本)

下载最新的版本参考第7点
https://twistedmatrix.com/Releases/Twisted/18.7/Twisted-18.7.0.tar.bz2
wget https://pypi.python.org/packages/source/T/Twisted/Twisted-18.7.0.tar.bz2

10.python3的安装:No module named _ssl

#修改Setup文件,去掉下面几行前面的注释
vi /python文件存储目录/Python-3.6.5/Modules/Setup.dist

#修改结果如下:
# Socket module helper for socket(2)
_socket socketmodule.c
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
SSL=/usr/local/ssl
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto

#然后重新编译安装
make
make install

ref:https://blog.csdn.net/chief_victo/article/details/80425431

11.ImportError: No module named ‘_sqlite3

yum install sqlite-devel
cd /文件存放目录/Python3.x
#重新编译安装
./configure
make
make install


ref:https://blog.csdn.net/yemazhuxing/article/details/80462112

 

centos7 安装docker

一、教程

官方doc:https://docs.docker.com/install/linux/docker-ce/centos/#upgrade-docker-ce

译:http://www.kevinli.com.cn/archives/28

二、error

Error: Package: docker-ce-17.03.0.ce-1.el7.centos.x86_64 (/docker-ce-17.03.0.ce-1.el7.centos.x86_64)
           Requires: docker-ce-selinux >= 17.03.0.ce-1.el7.centos
要先安装 docker-ce-selinux >= 17.03.0.ce-1.el7.centos

yum install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch.rpm

 

查询linux发行版本和内核版本

一、发行版本(release)
进入etc目录查看:system-release或者redhat-release或者centos-release
查看存在在的上述文件;

ls -al或者ll会给出软连接的指向:
system-release -> centos-release
redhat-release -> centos-release(说明系统为centos)

############
[root@izwz9ie21woahhphb55nscz etc]# cat system-release
CentOS Linux release 7.3.1611 (Core) 
[root@izwz9ie21woahhphb55nscz etc]# cat redhat-release 
CentOS Linux release 7.3.1611 (Core) 
[root@izwz9ie21woahhphb55nscz etc]# cat centos-release
CentOS Linux releas#e 7.3.1611 (Core)
############
lsb_release -a #适用于所有版本(Amazon Linux失效) 

root@izwz9ie21woahhphb55nscz WeChat]# lsb_release -a 
LSB Version: :core-4.1-amd64:core-4.1-noarch 
Distributor ID: CentOS 
Description: CentOS Linux release 7.3.1611 (Core) 
Release: 7.3.1611 
Codename: Core
二、内核版本(kernel)—–也可查32位还是64位
cat /proc/version

##############
[root@izwz9ie21woahhphb55nscz etc]# cat /proc/version
Linux version 3.10.0-514.26.2.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Tue Jul 4 15:04:05 UTC 2017
##############
uname -a

##############
[root@izwz9ie21woahhphb55nscz etc]# uname -a
Linux izwz9ie21woahhphb55nscz 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
##############

ref:https://www.cnblogs.com/wzk-0000/p/7483262.html