我需要一个简单的密码哈希函数,并认为我可以使用hashlib。PyCharm建议通过运行pip install hashLib来安装它。
但是现在PyCharm正在抱怨库中的语法错误:
Collecting hashLib
Using cached https://files.pythonhosted.org/packages/74/bb/9003d081345e9f0451884146e9ea2cff6e4cc4deac9ffd4a9ee98b318a49/hashlib-20081119.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/6_/8g1vyy5n1t1859x2d30ssk480000gn/T/pycharm-packaging/hashLib/setup.py", line 68
print "unknown OS, please update setup.py"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("unknown OS, please update setup.py")?
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/6_/8g1vyy5n1t1859x2d30ssk480000gn/T/pycharm-packaging/hashLib/它表明,这可能是与我正在使用的Python版本有关的问题(我尝试使用Python2.7和Python3.8,但它们都没有工作)。
确保您使用了这个包支持的Python版本。目前您正在使用Python3.8.
。
发布于 2019-11-26 06:03:44
hashlib现在在标准库中。这意味着您不需要安装它,它已经与Python安装在一起了。
您试图从PyPI安装的是非常老版本的Python (<= 2.4)。
https://stackoverflow.com/questions/59044602
复制相似问题