python:ImportError: No module named 'setuptools'

两种方法安装setuptools:

===1===

Python 2.x:    sudo apt-get install python-setuptools
Python 3.x:    sudo apt-get install python3-setuptools

如果安装后出现以下错误:AttributeError: module 'setuptools.dist' has no attribute 'check_specifier'

Python 2.x:
pip install --upgrade pip
hash -r pip

Python 3.x:
pip3 install --upgrade pip
hash -r pip3

cd (Mask RCNN root folder)
sudo python3 setup.py install

 

===2===

1 复制https://bootstrap.pypa.io/ez_setup.py中的内容,粘贴到.py文件,双击执行进行下载

2 解压setuptools安装包

3 进入setuptools包进行编译安装

Python 3.x:
python3 setup.py build
python3 setup.py install

 

你可能感兴趣的:(python)