解决服务器pip报黄色warning无法安装nb-cli

警告内容
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
解决方法
具体流程(备份)
然后执行命令仍然报错
参考该文章
执行
然后再次执行命令即可完成