docker技术的docker-compse用不了,出现Python 2 is no longer supported by the Python core team问题

运行docker-compose编译的时候,老是报错
docker技术的docker-compse用不了,出现Python 2 is no longer supported by the Python core team问题
初学docker,不熟,排了4、5个小时的雷,终于找到修改的位置了解决

报错信息:
Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release
翻译过来是:
核心团队不再支持Python 2。
现在,加密功能已不再支持该功能,并且在将来的发行版中将删除该功能。

第一

把docker-compose的python默认版本先给改了

1、先which看路径

which docker-compose
docker技术的docker-compse用不了,出现Python 2 is no longer supported by the Python core team问题
2、进入并把/usr/bin/docker-compose 里面的python2改为python
docker技术的docker-compse用不了,出现Python 2 is no longer supported by the Python core team问题
注意:这里直接改为python3 也会报错
docker技术的docker-compse用不了,出现Python 2 is no longer supported by the Python core team问题
.
所以

第二

给python3的运行文件 创建一个软连接 python

.
在这我建议新装一个python3,用自带的试过了不行,可以跟着这篇文章去装python3
很简单:https://www.jianshu.com/p/e191f9dc1186

ln -s /usr/local/python3/bin/python3.7 /usr/bin/python

注意:/usr/local/python3/bin/python3.7 这是我自己新安装python3.7.0的路径,要改为自己的python3的路径

查看一下软连接:
docker技术的docker-compse用不了,出现Python 2 is no longer supported by the Python core team问题

最后输入docker-compose 没报错
docker技术的docker-compse用不了,出现Python 2 is no longer supported by the Python core team问题
试试编译一个靶机
docker技术的docker-compse用不了,出现Python 2 is no longer supported by the Python core team问题

算是大功告成了