python3 报错 AttributeError: '_NamespacePath' object has no attribute 'sort'

版权声明:本文为博主原创文章,转载请注明出处 https://blog.csdn.net/vkingnew/article/details/86506695
运行环境:centos7 +python3.6.6
## pip3  install googleapis-common-protos
安装报错  AttributeError: '_NamespacePath' object has no attribute 'sort'
--解决办法:
[root@cdh-pd-db-4-172 tmp]# rpm -qa | grep -i setuptool
python34-setuptools-19.6.2-3.el7.noarch
python36-setuptools-39.2.0-1.el7.noarch
[root@cdh-pd-db-4-172 tmp]# rpm -e --nodeps python34-setuptools-19.6.2-3.el7.noarch
[root@cdh-pd-db-4-172 tmp]# rpm -qa | grep -i setuptool                            
python36-setuptools-39.2.0-1.el7.noarch

# pip3 list | grep -i setup
setuptools               28.8.0     

# pip3 uninstall setuptools==28.8.0
Uninstalling setuptools-28.8.0:
  Would remove:
    /usr/local/bin/easy_install-3.6
    /usr/local/lib/python3.6/site-packages/easy_install.py
    /usr/local/lib/python3.6/site-packages/pkg_resources/*
    /usr/local/lib/python3.6/site-packages/setuptools-28.8.0.dist-info/*
    /usr/local/lib/python3.6/site-packages/setuptools/*
Proceed (y/n)? y
  Successfully uninstalled setuptools-28.8.0

# pip3 install  setuptools

# pip3 list | grep -i setup
setuptools               40.6.3  

--pip版本升级:
#pip install --upgrade pip

# pip --version
pip 18.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)

--再重新安装:
# pip3  install googleapis-common-protos
Collecting googleapis-common-protos
  Using cached https://files.pythonhosted.org/packages/61/29/1549f61917eadd11650e42b78b4afcfe9cb467157af4510ab8cb59535f14/googleapis-common-protos-1.5.6.tar.gz
Requirement already satisfied: protobuf>=3.6.0 in /usr/local/lib/python3.6/site-packages (from googleapis-common-protos) (3.6.1)
Requirement already satisfied: setuptools in /usr/local/lib/python3.6/site-packages (from protobuf>=3.6.0->googleapis-common-protos) (40.6.3)
Requirement already satisfied: six>=1.9 in /usr/local/lib/python3.6/site-packages (from protobuf>=3.6.0->googleapis-common-protos) (1.11.0)
Installing collected packages: googleapis-common-protos
  Running setup.py install for googleapis-common-protos ... done
Successfully installed googleapis-common-protos-1.5.6

猜你喜欢

转载自blog.csdn.net/vkingnew/article/details/86506695
今日推荐