Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-2507

Workaround pip install failure: RuntimeError: Python 3.5 or later is required

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.12, 3.11.3, 4.0
    • Affects Version/s: None
    • Component/s: None
    • None

      Noticed will working on PYTHON-2502.

      Fix this pip error on macos Python 3.4:

       [2021/01/15 21:02:45.003] + python -m pip install --upgrade pip setuptools wheel
       [2021/01/15 21:02:45.680] removing build/bdist.macosx-10.6-intel/wheel
       [2021/01/15 21:02:45.680] Collecting pip
       [2021/01/15 21:02:45.680]   Downloading https://artifactory.corp.mongodb.com/artifactory/api/pypi/pypi/packages/54/eb/4a3642e971f404d69d4f6fa3885559d67562801b99d7592487f1ecc4e017/pip-20.3.3-py2.py3-none-any.whl (1.5MB)
       [2021/01/15 21:02:46.994] Collecting setuptools
       [2021/01/15 21:02:46.994]   Downloading https://artifactory.corp.mongodb.com/artifactory/api/pypi/pypi/packages/aa/d4/0089d680a610c7b5afda26c1ae588eb363b9050ccf5f33a8c2d1164210f3/setuptools-51.1.2-py3-none-any.whl (784kB)
       [2021/01/15 21:02:47.309] Collecting wheel
       [2021/01/15 21:02:47.309]   Downloading https://artifactory.corp.mongodb.com/artifactory/api/pypi/pypi/packages/65/63/39d04c74222770ed1589c0eaba06c05891801219272420b40311cd60c880/wheel-0.36.2-py2.py3-none-any.whl
       [2021/01/15 21:02:47.316] Installing collected packages: pip, setuptools, wheel
       [2021/01/15 21:02:47.316]   Found existing installation: pip 7.1.2
       [2021/01/15 21:02:48.192]     Uninstalling pip-7.1.2:
       [2021/01/15 21:02:48.192]       Successfully uninstalled pip-7.1.2
       [2021/01/15 21:02:48.192]   Found existing installation: setuptools 18.2
       [2021/01/15 21:02:48.224]     Uninstalling setuptools-18.2:
       [2021/01/15 21:02:48.224]       Successfully uninstalled setuptools-18.2
       [2021/01/15 21:02:48.656] + PYTHON=python
       [2021/01/15 21:02:48.656] + python -m pip install --upgrade dist/pymongo-4.0.dev0-cp34-cp34m-macosx_10_6_intel.whl
       [2021/01/15 21:02:48.870] Traceback (most recent call last):
       [2021/01/15 21:02:48.870]   File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/runpy.py", line 170, in _run_module_as_main
       [2021/01/15 21:02:48.870]     "__main__", mod_spec)
       [2021/01/15 21:02:48.870]   File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/runpy.py", line 85, in _run_code
       [2021/01/15 21:02:48.870]     exec(code, run_globals)
       [2021/01/15 21:02:48.870]   File "/data/mci/0c5156e5e22d35c8625f347a89522fa1/src/venvtestinstall/lib/python3.4/site-packages/pip/__main__.py", line 23, in <module>
       [2021/01/15 21:02:48.870]     from pip._internal.cli.main import main as _main  # isort:skip # noqa
       [2021/01/15 21:02:48.870]   File "/data/mci/0c5156e5e22d35c8625f347a89522fa1/src/venvtestinstall/lib/python3.4/site-packages/pip/_internal/cli/main.py", line 10, in <module>
       [2021/01/15 21:02:48.870]     from pip._internal.cli.autocompletion import autocomplete
       [2021/01/15 21:02:48.870]   File "/data/mci/0c5156e5e22d35c8625f347a89522fa1/src/venvtestinstall/lib/python3.4/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
       [2021/01/15 21:02:48.870]     from pip._internal.cli.main_parser import create_main_parser
       [2021/01/15 21:02:48.870]   File "/data/mci/0c5156e5e22d35c8625f347a89522fa1/src/venvtestinstall/lib/python3.4/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
       [2021/01/15 21:02:48.870]     from pip._internal.cli import cmdoptions
       [2021/01/15 21:02:48.870]   File "/data/mci/0c5156e5e22d35c8625f347a89522fa1/src/venvtestinstall/lib/python3.4/site-packages/pip/_internal/cli/cmdoptions.py", line 25, in <module>
       [2021/01/15 21:02:48.870]     from pip._internal.cli.progress_bars import BAR_TYPES
       [2021/01/15 21:02:48.870]   File "/data/mci/0c5156e5e22d35c8625f347a89522fa1/src/venvtestinstall/lib/python3.4/site-packages/pip/_internal/cli/progress_bars.py", line 12, in <module>
       [2021/01/15 21:02:48.870]     from pip._internal.utils.logging import get_indentation
       [2021/01/15 21:02:48.870]   File "/data/mci/0c5156e5e22d35c8625f347a89522fa1/src/venvtestinstall/lib/python3.4/site-packages/pip/_internal/utils/logging.py", line 18, in <module>
       [2021/01/15 21:02:48.870]     from pip._internal.utils.misc import ensure_dir
       [2021/01/15 21:02:48.870]   File "/data/mci/0c5156e5e22d35c8625f347a89522fa1/src/venvtestinstall/lib/python3.4/site-packages/pip/_internal/utils/misc.py", line 21, in <module>
       [2021/01/15 21:02:48.870]     from pip._vendor import pkg_resources
       [2021/01/15 21:02:48.870]   File "/data/mci/0c5156e5e22d35c8625f347a89522fa1/src/venvtestinstall/lib/python3.4/site-packages/pip/_vendor/pkg_resources/__init__.py", line 92, in <module>
       [2021/01/15 21:02:48.870]     raise RuntimeError("Python 3.5 or later is required")
       [2021/01/15 21:02:48.870] RuntimeError: Python 3.5 or later is required
       [2021/01/15 21:02:48.884] Successfully installed pip-20.3.3 setuptools-51.1.2 wheel-0.36.2
      

      The problem there is that pip is so old it happily installs a version which doesn't support 3.4 anymore. Since pip 2.1 will drop support for 2.7 and 3.5 as well we should also fix this issue for those python versions.

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: