Pip install hashlib help

Collecting hashlib
Using cached hashlib-20081119.zip (42 kB)
Installing build dependencies … done
Getting requirements to build wheel … error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
Traceback (most recent call last):
File “C:\Python311\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py”, line 353, in
main()
File “C:\Python311\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py”, line 335, in main
json_out[‘return_val’] = hook(**hook_input[‘kwargs’])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Python311\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py”, line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\marie\AppData\Local\Temp\pip-build-env-om3x_ore\overlay\Lib\site-packages\setuptools\build_meta.py”, line 341, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[‘wheel’])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\marie\AppData\Local\Temp\pip-build-env-om3x_ore\overlay\Lib\site-packages\setuptools\build_meta.py”, line 323, in _get_build_requires
self.run_setup()
File “C:\Users\marie\AppData\Local\Temp\pip-build-env-om3x_ore\overlay\Lib\site-packages\setuptools\build_meta.py”, line 488, in run_setup
self).run_setup(setup_script=setup_script)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\marie\AppData\Local\Temp\pip-build-env-om3x_ore\overlay\Lib\site-packages\setuptools\build_meta.py”, line 338, in run_setup
exec(code, locals())
File “”, line 68
print “unknown OS, please update setup.py”
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to ‘print’. Did you mean print(…)?
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

everytime I try to install it show this

Why are you trying to pip install hashlib in the first place? The
hashlib · PyPI module is only for Python
interpreters older than 2.5 (so more than 17 years old). Since then,
hashlib has been included with the Python interpreter in its
standard library of modules, so there should be no need to pip
install it separately:

You are trying to install the 2.x version of hashlib into 3.11. “This is a stand alone packaging of the hashlib library included with Python 2.5 so that it can be used on older versions of Python (tested on 2.3 and 2.4).”

If these backport libraries are going to stay on PyPI, there really needs to be some way to ensure that they do an appropriate version check before attempting installation. Even if that requires cooperation from the maintainers.

This particular package has been carefully designed to raise an exception if installed on any Python >= 3.0, as demonstrated by the OP.

FYI, see Handling modules on PyPI that are now in the standard library? for discussion of this issue and proposals to deal with it.

1 Like

Hahaha. That’s not a great “this is incompatible” message. - Cameron

Although it has already be said in passing, let me be explicit:

You’re using Python 3.11; you do not need to pip install hashlib, as
it is now part of the standard library.

Cheers,
Cameron Simpson cs@cskk.id.au

I know :slight_smile: But it is really REALLY hard, when writing a thing for Python 2.3/2.4, to predict what will be needed to make it work on Python 3. Or Python 4. Or anything else.

I mean, back when it was written, this was probably a perfectly reasonable version check:

import sys
if sys.version_info > (2, 5):
    print >>sys.stderr, "This package is not needed on Python 2.5."

But that’s exactly what would trigger this, uhh, unplanned version check. :smiley: