Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated easy_install; aka install not working on Ubuntu 22.04 #361

Open
AndreasFuchsTPM opened this issue Jun 20, 2022 · 3 comments

Comments

@AndreasFuchsTPM
Copy link
Member

pip install is not working on Ubuntu 22.04

Apparently, easy_install is deprecated, but also broken on Ubuntu 22.04; see pypa/setuptools#2938

So of course, Ubuntu should update setuptools but since easy_install is deprecated anyways, maybe pytss could update instead ?

Here is the error log

$ python3 -m pip install --user -e .
Obtaining file:///.../tpm2-pytss                                                                                                                                                               Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: cffi>=1.0.0 in /.../lib/python3.10/site-packages (from tpm2-pytss==1.2.0) (1.15.0)
Requirement already satisfied: pyyaml in /.../lib/python3/dist-packages (from tpm2-pytss==1.2.0) (5.4.1)
Requirement already satisfied: asn1crypto in /.../lib/python3.10/site-packages (from tpm2-pytss==1.2.0) (1.5.1)
Requirement already satisfied: cryptography>=3.0 in /.../lib/python3/dist-packages (from tpm2-pytss==1.2.0) (3.4.8)
Requirement already satisfied: packaging in /.../lib/python3.10/site-packages (from tpm2-pytss==1.2.0) (21.3)
Requirement already satisfied: pycparser in /.../lib/python3.10/site-packages (from cffi>=1.0.0->tpm2-pytss==1.2.0) (2.21)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /.../lib/python3/dist-packages (from packaging->tpm2-pytss==1.2.0) (2.4.7)
Installing collected packages: tpm2-pytss                                                                                                                                                                            Running setup.py develop for tpm2-pytss
    error: subprocess-exited-with-error

    × python setup.py develop did not run successfully.
    │ exit code: 1
    ╰─> [30 lines of output]
        adding path: /.../tpm2-pytss/scripts
        running develop
        /.../lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
          warnings.warn(
        Traceback (most recent call last):
          File "<string>", line 2, in <module>
          File "<pip-setuptools-caller>", line 34, in <module>
          File "/.../tpm2-pytss/setup.py", line 237, in <module>
            setup(
          File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup
            return distutils.core.setup(**attrs)
          File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 148, in setup
            return run_commands(dist)
          File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 163, in run_commands
            dist.run_commands()                                                                                                                                                                                              File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 967, in run_commands
            self.run_command(cmd)                                                                                                                                                                                            File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 985, in run_command
            cmd_obj.ensure_finalized()                                                                                                                                                                                       File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 107, in ensure_finalized
            self.finalize_options()
          File "/usr/lib/python3/dist-packages/setuptools/command/develop.py", line 52, in finalize_options
            easy_install.finalize_options(self)
          File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 270, in finalize_options
            self._fix_install_dir_for_user_site()                                                                                                                                                                         File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 400, in _fix_install_dir_for_user_site                                                                                                self.select_scheme(scheme_name)                                                                                                                                                                                  File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 741, in select_scheme                                                                                                                 scheme = INSTALL_SCHEMES[name]
        KeyError: 'unix_user'
        [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error                                                                                                                                                                                
× python setup.py develop did not run successfully.                                                                                                                                                                │ exit code: 1                                                                                                                                                                                                     ╰─> [30 lines of output]                                                                                                                                                                                               adding path: /.../tpm2-pytss/scripts                                                                                                                                                         running develop                                                                                                                                                                                                    /usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.                         warnings.warn(
    Traceback (most recent call last):
      File "<string>", line 2, in <module>
      File "<pip-setuptools-caller>", line 34, in <module>
      File "/.../tpm2-pytss/setup.py", line 237, in <module>
        setup(
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 148, in setup                                                                                                                              return run_commands(dist)
      File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 163, in run_commands
        dist.run_commands()
      File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 967, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 985, in run_command
        cmd_obj.ensure_finalized()
      File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 107, in ensure_finalized
        self.finalize_options()
      File "/usr/lib/python3/dist-packages/setuptools/command/develop.py", line 52, in finalize_options
        easy_install.finalize_options(self)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 270, in finalize_options                                                                                                              self._fix_install_dir_for_user_site()
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 400, in _fix_install_dir_for_user_site                                                                                                self.select_scheme(scheme_name)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 741, in select_scheme                                                                                                                 scheme = INSTALL_SCHEMES[name]                                                                                                                                                                                 KeyError: 'unix_user'
    [end of output]                                                                                                                                                                                                
note: This error originates from a subprocess, and is likely not a problem with pip.
@whooo
Copy link
Contributor

whooo commented Jun 21, 2022

As it's internal to setuptools it's hard to replace, there seems to be a PEP-660 implementation in the main branch now ( pypa/setuptools#3265 ) which we could test when there is a release with it included.

@williamcroberts
Copy link
Member

We don't use easy_install components AFAICT so I don't think theirs anything to fix for us

@AndreasFuchsTPM
Copy link
Member Author

Hmmm... So setuptools is just broken...

In any case; Ubuntu 22.04 pip --user install fails.
Workaround was a venv. (As with everything)

Maybe this helps someone, until ubuntu's setuptools is fixed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants