无法安装 hashlib、python 3、debian
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/45131890/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Failed to install hashlib, python 3, debian
提问by dipl0
The software fails to install. Any help in resolving this would be appreciated.
软件安装失败。任何解决此问题的帮助将不胜感激。
I believe that the error is probably a dependency error.
我认为该错误可能是依赖项错误。
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
----------------------------------------
I am using this library to generate hashes for files and so alternative solutions would also be welcome.
我正在使用这个库来生成文件的哈希值,因此也欢迎替代解决方案。
采纳答案by Arman Ordookhani
hashlib
module is installed by default (I think Python 2.6+). You are trying to install a backport of it created for forward compatibility of old Python versions.
hashlib
模块是默认安装的(我认为是 Python 2.6+)。您正在尝试安装为旧 Python 版本的向前兼容性而创建的向后移植。
Just do import hashlib
and do your stuff.
只是做import hashlib
,做你的东西。
You could find info about packages by searching in https://pypi.python.org/pypi.
您可以通过在https://pypi.python.org/pypi 中搜索来找到有关包的信息。