virtualenv: Can't create new virtual environment under py2 after setuptools(45.0.0) which is never support py2

Please add version limit for setuptools , like setuptools~=44.0.0 , thanks

Collecting setuptools
  Created temporary directory: /private/var/folders/vg/4nf1fyxd26j3tjkt0yn5yxnm0000gn/T/pip-unpack-gj5u9h
  Resetting dropped connection: devpi.intra.xx.cn
  http://devpi.intra.xx.cn:80 "GET /root/mirror/%2Bf/616/b116b122e4140/setuptools-45.0.0-py2.py3-none-any.whl HTTP/1.1" 200 583778
  Downloading http://devpi.intra.xx.cn/root/mirror/%2Bf/616/b116b122e4140/setuptools-45.0.0-py2.py3-none-any.whl (583kB)
  Added setuptools from http://devpi.intra.xx.cn/root/mirror/%2Bf/616/b116b122e4140/setuptools-45.0.0-py2.py3-none-any.whl#md5=616b116b122e41402ae52f8706c4b372 to build tracker '/private/var/folders/vg/4nf1fyxd26j3tjkt0yn5yxnm0000gn/T/pip-req-tracker-ea12_L'
  Removed setuptools from http://devpi.intra.xx.cn/root/mirror/%2Bf/616/b116b122e4140/setuptools-45.0.0-py2.py3-none-any.whl#md5=616b116b122e41402ae52f8706c4b372 from build tracker '/private/var/folders/vg/4nf1fyxd26j3tjkt0yn5yxnm0000gn/T/pip-req-tracker-ea12_L'
Cleaning up...
Removed build tracker '/private/var/folders/vg/4nf1fyxd26j3tjkt0yn5yxnm0000gn/T/pip-req-tracker-ea12_L'
ERROR: Package 'setuptools' requires a different Python: 2.7.13 not in '>=3.5'
Exception information:
Traceback (most recent call last):
  File "/Users/moore/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv_support/pip-19.3.1-py2.py3-none-any.whl/pip/_internal/cli/base_command.py", line 153, in _main
    status = self.run(options, args)
  File "/Users/moore/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv_support/pip-19.3.1-py2.py3-none-any.whl/pip/_internal/commands/install.py", line 382, in run
    resolver.resolve(requirement_set)
  File "/Users/moore/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv_support/pip-19.3.1-py2.py3-none-any.whl/pip/_internal/legacy_resolve.py", line 201, in resolve
    self._resolve_one(requirement_set, req)
  File "/Users/moore/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv_support/pip-19.3.1-py2.py3-none-any.whl/pip/_internal/legacy_resolve.py", line 373, in _resolve_one
    ignore_requires_python=self.ignore_requires_python,
  File "/Users/moore/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv_support/pip-19.3.1-py2.py3-none-any.whl/pip/_internal/legacy_resolve.py", line 105, in _check_dist_requires_python
    dist.project_name, version, requires_python,
UnsupportedPythonVersion: Package 'setuptools' requires a different Python: 2.7.13 not in '>=3.5'
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
  File "/Users/moore/.pyenv/versions/2.7.13/bin/virtualenv", line 8, in <module>
    sys.exit(main())
  File "/Users/moore/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 870, in main
    symlink=options.symlink,
  File "/Users/moore/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 1179, in create_environment
    install_wheel(to_install, py_executable, search_dirs, download=download)
  File "/Users/moore/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 1023, in install_wheel
    _install_wheel_with_search_dir(download, project_names, py_executable, search_dirs)
  File "/Users/moore/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 1116, in _install_wheel_with_search_dir
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=script)
  File "/Users/moore/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 963, in call_subprocess
    raise OSError("Command {} failed with error code {}".format(cmd_desc, proc.returncode))
OSError: Command /Volumes/Develop/test/test/bin/python2.7 - setuptools pip wheel failed with error code 1

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (12 by maintainers)

Most upvoted comments

Also, do you have any sort of private PyPI mirror configured? If you have a mirror that doesn’t supply the data-requires-python tag, pip won’t know that setuptools 45.0.0 needs Python 3 when it looks for candidates, it will only find out once the install has been started - which would give the behaviour you are seeing.

the bundled pip automatically can understand python-requires of setuptools

@gaborbernat How does virtualenv select which (bundled) setuptools to install? If it’s relying on Python-Requires it has to use an index, not just a local directory with --find-links, for example…