Installing hashLib gives SyntaxError: Missing parentheses in call to #39;print#39;(安装 hashLib 会出现 SyntaxError: Missing parentheses in call to print)
问题描述
我需要一个简单的密码哈希函数,并认为我可以使用 hashlib
.PyCharm 建议通过运行 pip install hashLib
来安装它.
I needed a simple hash function for passwords and thought I could use hashlib
. PyCharm suggested to install it by running pip install hashLib
.
但是现在 PyCharm 正在抱怨库中的语法错误:
But now PyCharm is complaining about a syntax error in the library:
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 版本有关(我尝试使用 Python 2.7 和 Python 3.8,但它们都不起作用).
It suggests that it may be a problem related to the Python version I am using (I tried with Python 2.7 and Python 3.8, but none of them worked).
确保您使用的是此软件包支持的 Python 版本.目前您使用的是 Python 3.8.
Make sure that you use a version of Python supported by this package. Currently you are using Python 3.8.
推荐答案
hashlib
现在在标准库中.这意味着您不需要安装它,它已经在您的 Python 安装中.
hashlib
is in the standard library now. That means you don't need to install it, it's there already with your Python installation.
您尝试从 PyPI 安装的版本适用于 非常 旧版本的 Python (<= 2.4).
The one you tried to install from PyPI is for very old versions of Python (<= 2.4).
这篇关于安装 hashLib 会出现 SyntaxError: Missing parentheses in call to 'print'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:安装 hashLib 会出现 SyntaxError: Missing parentheses in


基础教程推荐
- 用于分类数据的跳跃记号标签 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- 筛选NumPy数组 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01