--Environnement: Cloud9
$ pip install hmac
Defaulting to user installation because normal site-packages is not writeable
Collecting hmac
Downloading hmac-20101005.tar.gz (4.5 kB)
Requirement already satisfied: setuptools in /usr/lib/python3.6/dist-packages (from hmac) (36.2.7)
Collecting hashlib
Downloading hashlib-20081119.zip (42 kB)
|████████████████████████████████| 42 kB 1.1 MB/s
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-5jes0rhx/hashlib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-5jes0rhx/hashlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-uvx1s968
cwd: /tmp/pip-install-5jes0rhx/hashlib/
Complete output (22 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.6/dist-packages/setuptools/__init__.py", line 10, in <module>
from setuptools.extern.six.moves import filter, map
File "/usr/lib/python3.6/dist-packages/setuptools/extern/__init__.py", line 1, in <module>
from pkg_resources.extern import VendorImporter
File "/usr/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 36, in <module>
import email.parser
File "/usr/lib64/python3.6/email/parser.py", line 12, in <module>
from email.feedparser import FeedParser, BytesFeedParser
File "/usr/lib64/python3.6/email/feedparser.py", line 27, in <module>
from email._policybase import compat32
File "/usr/lib64/python3.6/email/_policybase.py", line 9, in <module>
from email.utils import _has_surrogates
File "/usr/lib64/python3.6/email/utils.py", line 28, in <module>
import random
File "/usr/lib64/python3.6/random.py", line 46, in <module>
from hashlib import sha512 as _sha512
File "/tmp/pip-install-5jes0rhx/hashlib/hashlib.py", line 80
raise ValueError, "unsupported hash type"
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Il semble que hmac et hashlib soient disponibles même si vous ne les installez pas ...
Requirement already satisfied: setuptools in /usr/lib/python3.6/dist-packages (from hmac) (36.2.7)
Il est écrit.
Une fois que vous connaissez le résultat, vous ne comprenez pas pourquoi vous avez essayé de l'installer pour le moment.
Référence: [python - Erreur de type de hachage non prise en charge lors de l'installation de hashlib à l'aide de pip3 --Stack Overflow](https://stackoverflow.com/questions/46129813/unsupported-hash-type-error- while-installing-hashlib-using-pip3)
OK si vous écrivez et utilisez import hmac, hashlib
Recommended Posts