pypa / setuptools

Official project repository for the Setuptools build system
https://pypi.org/project/setuptools/
MIT License
2.5k stars 1.19k forks source link

setuptool in pip #2005

Closed Stephanevg closed 4 years ago

Stephanevg commented 4 years ago

Hi,

I am not super familiar with all of this stuff, but I have the impression it is a tangent to this issue here:

https://github.com/pypa/setuptools/issues/2004

I am trying to deploy a linux machine using vagrant and install the pywinrm on that machine. It fails with the following message:

RuntimeError: cryptography requires setuptools 18.5 or newer, please upgrade to a newer version of setuptools

this is the current version of setuptools I have installed

vagrant@vagrant-ubuntu-trusty-64:~$ hostnamectl
   Static hostname: vagrant-ubuntu-trusty-64
         Icon name: computer-vm
           Chassis: vm
           Boot ID: a0191b63293c41e398c6565c1ed115e6
  Operating System: Ubuntu 14.04.6 LTS
            Kernel: Linux 3.13.0-170-generic
      Architecture: x86_64
vagrant@vagrant-ubuntu-trusty-64:~$ pip list | grep setuptools
setuptools (3.3)

so, I tried to update setup tools but it failed

vagrant@vagrant-ubuntu-trusty-64:~$ pip install setuptools --upgrade
Downloading/unpacking setuptools from https://files.pythonhosted.org/packages/68/75/d1d7b7340b9eb6e0388bf95729e63c410b381eb71fe8875cdfd949d8f9ce/setuptools-45.2.0.zip#sha256=89c6e6011ec2f6d57d43a3f9296c4ef022c2cbf49bab26b407fe67992ae3397f
  Downloading setuptools-45.2.0.zip (859kB): 859kB downloaded
  Running setup.py (path:/tmp/pip_build_vagrant/setuptools/setup.py) egg_info for package setuptools
    pkg_resources/py2_warn.py:22: UserWarning: Setuptools will stop working on Python 2
    ************************************************************
    You are running Setuptools on Python 2, which is no longer
    supported and
    >>> SETUPTOOLS WILL STOP WORKING <<<
    in a subsequent release (no sooner than 2020-04-20).
    Please ensure you are installing
    Setuptools using pip 9.x or later or pin to `setuptools<45`
    in your environment.
    If you have done those things and are still encountering
    this message, please comment in
    https://github.com/pypa/setuptools/issues/1458
    about the steps that led to this unsupported combination.
    ************************************************************
      sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60)
    /tmp/pip_build_vagrant/setuptools/setup.py:12: PkgResourcesDeprecationWarning: Parameters to load are deprecated.  Call .resolve and .require separately.

    warning: no files found matching '*.py' under directory 'tests'
    warning: no previously-included files found matching 'pyproject.toml'
Installing collected packages: setuptools
  Found existing installation: setuptools 3.3
    Not uninstalling setuptools at /usr/lib/python2.7/dist-packages, owned by OS
  Running setup.py install for setuptools
    pkg_resources/py2_warn.py:22: UserWarning: Setuptools will stop working on Python 2
    ************************************************************
    You are running Setuptools on Python 2, which is no longer
    supported and
    >>> SETUPTOOLS WILL STOP WORKING <<<
    in a subsequent release (no sooner than 2020-04-20).
    Please ensure you are installing
    Setuptools using pip 9.x or later or pin to `setuptools<45`
    in your environment.
    If you have done those things and are still encountering
    this message, please comment in
    https://github.com/pypa/setuptools/issues/1458
    about the steps that led to this unsupported combination.
    ************************************************************
      sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60)
    error: could not create '/usr/local/lib/python2.7/dist-packages/pkg_resources': Permission denied
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_vagrant/setuptools/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Pej2O_-record/install-record.txt --single-version-externally-managed --compile:
    pkg_resources/py2_warn.py:22: UserWarning: Setuptools will stop working on Python 2

************************************************************

You are running Setuptools on Python 2, which is no longer

supported and

>>> SETUPTOOLS WILL STOP WORKING <<<

in a subsequent release (no sooner than 2020-04-20).

Please ensure you are installing

Setuptools using pip 9.x or later or pin to `setuptools<45`

in your environment.

If you have done those things and are still encountering

this message, please comment in

https://github.com/pypa/setuptools/issues/1458

about the steps that led to this unsupported combination.

************************************************************

  sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60)

running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

copying easy_install.py -> build/lib.linux-x86_64-2.7

creating build/lib.linux-x86_64-2.7/pkg_resources

copying pkg_resources/__init__.py -> build/lib.linux-x86_64-2.7/pkg_resources

copying pkg_resources/py31compat.py -> build/lib.linux-x86_64-2.7/pkg_resources

copying pkg_resources/py2_warn.py -> build/lib.linux-x86_64-2.7/pkg_resources

creating build/lib.linux-x86_64-2.7/setuptools

copying setuptools/depends.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/py33compat.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/extension.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/namespaces.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/monkey.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/wheel.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/build_meta.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/__init__.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/py27compat.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/_deprecation_warning.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/ssl_support.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/lib2to3_ex.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/_imp.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/archive_util.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/unicode_utils.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/version.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/config.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/site-patch.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/py31compat.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/installer.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/dist.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/sandbox.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/errors.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/package_index.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/py34compat.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/windows_support.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/msvc.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/launch.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/dep_util.py -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/glob.py -> build/lib.linux-x86_64-2.7/setuptools

creating build/lib.linux-x86_64-2.7/pkg_resources/_vendor

copying pkg_resources/_vendor/__init__.py -> build/lib.linux-x86_64-2.7/pkg_resources/_vendor

copying pkg_resources/_vendor/appdirs.py -> build/lib.linux-x86_64-2.7/pkg_resources/_vendor

copying pkg_resources/_vendor/six.py -> build/lib.linux-x86_64-2.7/pkg_resources/_vendor

copying pkg_resources/_vendor/pyparsing.py -> build/lib.linux-x86_64-2.7/pkg_resources/_vendor

creating build/lib.linux-x86_64-2.7/pkg_resources/extern

copying pkg_resources/extern/__init__.py -> build/lib.linux-x86_64-2.7/pkg_resources/extern

creating build/lib.linux-x86_64-2.7/pkg_resources/_vendor/packaging

copying pkg_resources/_vendor/packaging/__init__.py -> build/lib.linux-x86_64-2.7/pkg_resources/_vendor/packaging

copying pkg_resources/_vendor/packaging/_compat.py -> build/lib.linux-x86_64-2.7/pkg_resources/_vendor/packaging

copying pkg_resources/_vendor/packaging/_structures.py -> build/lib.linux-x86_64-2.7/pkg_resources/_vendor/packaging

copying pkg_resources/_vendor/packaging/version.py -> build/lib.linux-x86_64-2.7/pkg_resources/_vendor/packaging

copying pkg_resources/_vendor/packaging/specifiers.py -> build/lib.linux-x86_64-2.7/pkg_resources/_vendor/packaging

copying pkg_resources/_vendor/packaging/__about__.py -> build/lib.linux-x86_64-2.7/pkg_resources/_vendor/packaging

copying pkg_resources/_vendor/packaging/markers.py -> build/lib.linux-x86_64-2.7/pkg_resources/_vendor/packaging

copying pkg_resources/_vendor/packaging/requirements.py -> build/lib.linux-x86_64-2.7/pkg_resources/_vendor/packaging

copying pkg_resources/_vendor/packaging/utils.py -> build/lib.linux-x86_64-2.7/pkg_resources/_vendor/packaging

creating build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/test.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/install_egg_info.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/__init__.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/saveopts.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/alias.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/bdist_wininst.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/register.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/bdist_rpm.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/py36compat.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/setopt.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/upload_docs.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/install_lib.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/bdist_egg.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/develop.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/rotate.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/dist_info.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/build_clib.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/build_ext.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/sdist.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/upload.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/install.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/install_scripts.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/build_py.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/egg_info.py -> build/lib.linux-x86_64-2.7/setuptools/command

copying setuptools/command/easy_install.py -> build/lib.linux-x86_64-2.7/setuptools/command

creating build/lib.linux-x86_64-2.7/setuptools/_vendor

copying setuptools/_vendor/__init__.py -> build/lib.linux-x86_64-2.7/setuptools/_vendor

copying setuptools/_vendor/six.py -> build/lib.linux-x86_64-2.7/setuptools/_vendor

copying setuptools/_vendor/ordered_set.py -> build/lib.linux-x86_64-2.7/setuptools/_vendor

copying setuptools/_vendor/pyparsing.py -> build/lib.linux-x86_64-2.7/setuptools/_vendor

creating build/lib.linux-x86_64-2.7/setuptools/extern

copying setuptools/extern/__init__.py -> build/lib.linux-x86_64-2.7/setuptools/extern

creating build/lib.linux-x86_64-2.7/setuptools/_vendor/packaging

copying setuptools/_vendor/packaging/__init__.py -> build/lib.linux-x86_64-2.7/setuptools/_vendor/packaging

copying setuptools/_vendor/packaging/_compat.py -> build/lib.linux-x86_64-2.7/setuptools/_vendor/packaging

copying setuptools/_vendor/packaging/_structures.py -> build/lib.linux-x86_64-2.7/setuptools/_vendor/packaging

copying setuptools/_vendor/packaging/version.py -> build/lib.linux-x86_64-2.7/setuptools/_vendor/packaging

copying setuptools/_vendor/packaging/tags.py -> build/lib.linux-x86_64-2.7/setuptools/_vendor/packaging

copying setuptools/_vendor/packaging/specifiers.py -> build/lib.linux-x86_64-2.7/setuptools/_vendor/packaging

copying setuptools/_vendor/packaging/__about__.py -> build/lib.linux-x86_64-2.7/setuptools/_vendor/packaging

copying setuptools/_vendor/packaging/markers.py -> build/lib.linux-x86_64-2.7/setuptools/_vendor/packaging

copying setuptools/_vendor/packaging/requirements.py -> build/lib.linux-x86_64-2.7/setuptools/_vendor/packaging

copying setuptools/_vendor/packaging/utils.py -> build/lib.linux-x86_64-2.7/setuptools/_vendor/packaging

copying setuptools/script (dev).tmpl -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/script.tmpl -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/gui-32.exe -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/gui-64.exe -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/cli-64.exe -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/cli-32.exe -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/gui.exe -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/cli.exe -> build/lib.linux-x86_64-2.7/setuptools

copying setuptools/command/launcher manifest.xml -> build/lib.linux-x86_64-2.7/setuptools/command

running install_lib

creating /usr/local/lib/python2.7/dist-packages/pkg_resources

error: could not create '/usr/local/lib/python2.7/dist-packages/pkg_resources': Permission denied

----------------------------------------
  Can't roll back setuptools; was not uninstalled
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_vagrant/setuptools/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Pej2O_-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_vagrant/setuptools
Storing debug log for failure in /home/vagrant/.pip/pip.log
vagrant@vagrant-ubuntu-trusty-64:~$ 
vagrant@vagrant-ubuntu-trusty-64:~$ pip -V
/usr/local/lib/python2.7/dist-packages/pkg_resources/py2_warn.py:22: UserWarning: Setuptools will stop working on Python 2
************************************************************
You are running Setuptools on Python 2, which is no longer
supported and
>>> SETUPTOOLS WILL STOP WORKING <<<
in a subsequent release (no sooner than 2020-04-20).
Please ensure you are installing
Setuptools using pip 9.x or later or pin to `setuptools<45`
in your environment.
If you have done those things and are still encountering
this message, please comment in
https://github.com/pypa/setuptools/issues/1458
about the steps that led to this unsupported combination.
************************************************************
  sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60)
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)
vagrant@vagrant-ubuntu-trusty-64:~$ 

Can anyone of you advise what I should do to fix this?

thanks in advance!

jaraco commented 4 years ago

Before you can upgrade setuptools, you should upgrade pip (pip install -U pip). You want at least pip 9 or later to upgrade setuptools safely on Python 2.

However, if you're not wed to Ubuntu Trusty, I'd strongly recommend using something newer (Ubuntu Bionic) and Python 3.