Description
chainer>=7.0.0
released before #8517 is still released to Python 2, even though they doesn't support Python 2.
Due to this, we cannot use pip install chainer
in Python 2. Instead, we always have to specify install version like pip install chainer<7.0.0
.
$ pip install --user chainer --no-cache-dir -U
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
warnings.warn(warning, RequestsDependencyWarning)
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting chainer
Downloading https://files.pythonhosted.org/packages/a8/ba/32b704e077cb24b4d85260512a5af903e772f06fb58e716301dd51758869/chainer-7.0.0.tar.gz (1.0MB)
|████████████████████████████████| 1.0MB 8.1MB/s
Requirement already satisfied, skipping upgrade: setuptools in /usr/lib/python2.7/dist-packages (from chainer) (20.7.0)
Requirement already satisfied, skipping upgrade: typing_extensions in /usr/local/lib/python2.7/dist-packages (from chainer) (3.6.6)
Requirement already satisfied, skipping upgrade: filelock in /usr/local/lib/python2.7/dist-packages (from chainer) (3.0.12)
Requirement already satisfied, skipping upgrade: numpy>=1.9.0 in /usr/lib/python2.7/dist-packages (from chainer) (1.11.0)
Requirement already satisfied, skipping upgrade: protobuf>=3.0.0 in /usr/local/lib/python2.7/dist-packages (from chainer) (3.7.1)
Requirement already satisfied, skipping upgrade: six>=1.9.0 in /usr/local/lib/python2.7/dist-packages (from chainer) (1.12.0)
Requirement already satisfied, skipping upgrade: typing>=3.6.2 in /usr/local/lib/python2.7/dist-packages (from typing_extensions->chainer) (3.6.6)
Building wheels for collected packages: chainer
Building wheel for chainer (setup.py) ... done
Created wheel for chainer: filename=chainer-7.0.0-cp27-none-any.whl size=966689 sha256=5d7d792512b88770a53c52e193fd05d6d1e3d978e4c7e8f6dcd1abc6980ea5ed
Stored in directory: /tmp/pip-ephem-wheel-cache-MwgxDb/wheels/42/ab/c8/d723d9d7a08b5649c7343f113e74c729d4a1bd5d96e349294b
Successfully built chainer
Installing collected packages: chainer
Successfully installed chainer-7.0.0
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
$ python -c 'import chainer'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/pazeshun/.local/lib/python2.7/site-packages/chainer/__init__.py", line 10, in <module>
from chainer import backends # NOQA
File "/home/pazeshun/.local/lib/python2.7/site-packages/chainer/backends/__init__.py", line 1, in <module>
from chainer.backends import cuda # NOQA
File "/home/pazeshun/.local/lib/python2.7/site-packages/chainer/backends/cuda.py", line 77
def shape(self) -> types.Shape:
^
SyntaxError: invalid syntax
This situation easily causes mistakes of installing incompatible versions.
In addition, this is problem when using ROS.
In ROS, we want to resolve all dependency with rosdep install
command, but its philosophy is like apt
and it doesn't have a method to specify install version.
http://wiki.ros.org/ROS/Tutorials/rosdep
(Now we are working on making exceptions of Python packages in that philosophy, but the discussion doesn't advance:
ros-infrastructure/rosdep#694)
I know released version cannot be overwritten,
https://stackoverflow.com/questions/21064581/how-to-overwrite-pypi-package-when-doing-upload-from-command-line
so solutions I know are the following:
- Release Python 2 compatible version to
chainer>=7.0.0
(very strange solution) - Remove
chainer>=7.0.0
released before Do not install chainer>=7.0.0 in python2 #8517 (very drastic solution)
I know this is difficult problem, but hope this is solved.
cf. #8517 (comment)