记一次安装 docker-compose 遇到的坑

最近看了下 全链路分布式监控 想搭个环境看看怎么玩 了解了解 这不 第一步装 docker-compose 就遇到了好几次坑... ...

[root@localhost ~]# cat /etc/redhat-release 
CentOS Linux release 7.4.1708 (Core) 
[root@localhost ~]# python -V
Python 2.7.5
[root@localhost ~]# pip -V
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)
[root@localhost ~]# 

[root@localhost ~]# pip install docker-compose
... ...

查了下资料,缺少python 环境包

yum -y install python-devel python-subprocess32

装完 再 pip install docker-compose 试试

又遇到了一个....
提示大意有东西没卸载完全.. 解决方法找出来 把它干掉

ERROR: Cannot uninstall 'subprocess32'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

找了下资料 记录下:

解决办法:
找到subprocess32.egg-info,一般就在usr/lib/python2.7或者其他安装pythonxxx dist-packages等路径里,可以直接在/目录下全局搜索。然后删掉即可.
其他的package遇到这种情况方法也通用,搜索<package name>.egg-info,找到后删除即可

[root@node01 pinpoint-docker]# find / -name *subpro*.egg-info
/usr/lib64/python2.7/site-packages/subprocess32-3.2.6-py2.7.egg-info
[root@node01 pinpoint-docker]# rm -f /usr/lib64/python2.7/site-packages/subprocess32-3.2.6-py2.7.egg-info
[root@node01 pinpoint-docker]# pip install docker-compose
... ...


# 终于好了
[root@node01 pinpoint-docker]# docker-compose -v
docker-compose version 1.25.0, build b42d419
[root@node01 pinpoint-docker]# 

附上前人遇到并提供的解决方法,感谢

https://www.cnblogs.com/felixqiang/p/11946644.html

comments powered by Disqus