安装 hashlib 失败,python 3、debian

Failed to install hashlib, python 3, debian

软件安装失败。解决此问题的任何帮助将不胜感激。

我认为该错误可能是依赖项错误。

             Running setup.py (path:/tmp/pip-build-9rlb94_r/hashlib/setup.py) egg_info for package hashlib
            Traceback (most recent call last):
              File "<string>", line 3, in <module>
              File "/usr/local/lib/python3.4/dist-packages/setuptools/__init__.py", line 10, in <module>
                from setuptools.extern.six.moves import filter, map
              File "/usr/local/lib/python3.4/dist-packages/setuptools/extern/__init__.py", line 1, in <module>
                from pkg_resources.extern import VendorImporter
              File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 36, in <module>
                import email.parser
              File "/usr/lib/python3.4/email/parser.py", line 12, in <module>
                from email.feedparser import FeedParser, BytesFeedParser
              File "/usr/lib/python3.4/email/feedparser.py", line 27, in <module>
                from email import message
              File "/usr/lib/python3.4/email/message.py", line 16, in <module>
                from email import utils
              File "/usr/lib/python3.4/email/utils.py", line 28, in <module>
                import random
              File "/usr/lib/python3.4/random.py", line 45, in <module>
                from hashlib import sha512 as _sha512
              File "/tmp/pip-build-9rlb94_r/hashlib/hashlib.py", line 80
                raise ValueError, "unsupported hash type"
                                ^
            SyntaxError: invalid syntax
            Complete output from command python setup.py egg_info:
            Traceback (most recent call last):

          File "<string>", line 3, in <module>

          File "/usr/local/lib/python3.4/dist-packages/setuptools/__init__.py", line 10, in <module>

            from setuptools.extern.six.moves import filter, map

          File "/usr/local/lib/python3.4/dist-packages/setuptools/extern/__init__.py", line 1, in <module>

            from pkg_resources.extern import VendorImporter

          File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 36, in <module>

            import email.parser

          File "/usr/lib/python3.4/email/parser.py", line 12, in <module>

            from email.feedparser import FeedParser, BytesFeedParser

          File "/usr/lib/python3.4/email/feedparser.py", line 27, in <module>

            from email import message

          File "/usr/lib/python3.4/email/message.py", line 16, in <module>

            from email import utils

          File "/usr/lib/python3.4/email/utils.py", line 28, in <module>

            import random

          File "/usr/lib/python3.4/random.py", line 45, in <module>

            from hashlib import sha512 as _sha512

          File "/tmp/pip-build-9rlb94_r/hashlib/hashlib.py", line 80

            raise ValueError, "unsupported hash type"

                            ^

        SyntaxError: invalid syntax

        ----------------------------------------

我正在使用这个库为文件生成哈希值,因此也欢迎使用其他解决方案。

默认安装

hashlib 模块(我认为 Python 2.6+)。您正在尝试安装为旧 Python 版本的向前兼容而创建的它的向后移植。

只做 import hashlib 做你的事。

您可以通过在 https://pypi.python.org/pypi 中搜索找到有关包的信息。