PS D:\lenovo_work\workspace\lenovo_git\lico-image\docker> git diff .\caffe\caffe-1.0-cpu
diff --git a/docker/caffe/caffe-1.0-cpu b/docker/caffe/caffe-1.0-cpu
index 086b239..445cb3f 100644
--- a/docker/caffe/caffe-1.0-cpu
+++ b/docker/caffe/caffe-1.0-cpu
@@ -22,13 +22,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
protobuf-compiler \
python-dev \
python-numpy \
- python-pip \
python-setuptools \
python-scipy && \
rm -rf /var/lib/apt/lists/*
WORKDIR /opt
RUN git clone -b 1.0 --depth 1 https://github.com/BVLC/caffe.git
-RUN pip --default-timeout=100 install -U 'pip>=10.0'
+RUN wget https://bootstrap.pypa.io/pip/2.7/get-pip.py && python get-pip.py
RUN pip --default-timeout=100 install scikit-learn==0.20.4
RUN export LC_ALL=C
WORKDIR /opt/caffe/python
python2 中 pip
指定安装 python2 的 pip
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py && python get-pip.py
pip==20.3.4 是 pip 中 支持 python2 的最高版本。
在之后的版本 (如 pip>=21.0) 就舍弃了python2 (使用会 error, ). 只支持 python3.
Note: pip 21.0, in January 2021, removed Python 2 support, per pip’s Python 2 support policy. Please migrate to Python 3.
https://pypi.org/project/pip/
Python 2 Support
pip 20.3 was the last version of pip that supported Python 2. Bugs reported with pip which only occur on Python 2.7 will likely be closed as “won’t fix” issues by pip’s maintainers
ubuntu 中 pip
1
https://stackoverflow.com/questions/37495375/python-pip-install-throws-typeerror-unsupported-operand-types-for-retry
Python PIP Install throws TypeError: unsupported operand type(s) for -=: ‘Retry’ and ‘int’
sunny@sunny:~$ pip install requests
Collecting requests
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/adapter.py", line 46, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/adapters.py", line 376, in send
timeout=timeout
File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 610, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 228, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
Ubuntu comes with a version of PIP from precambrian and that’s how you have to upgrade it if you do not want to spend hours and hours debugging pip related issues.
apt-get remove python-pip python3-pip
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
python3 get-pip.py
As you observed I included information for both Python 2.x and 3.x
2
https://askubuntu.com/questions/926911/unable-to-uninstall-programs-using-sudo-pip/926914
I looked this up online but they’re all suggesting using sudo command I used
sudo pip uninstall numpy
I get this message:
Not uninstalling numpy at /usr/lib/python2.7/dist-packages, outside environment /usr