首页 新闻 会员 周边

pip安装ssl的报错。

0
悬赏园豆:50 [已解决问题] 解决于 2023-04-24 09:47

pip安装ssl的报错。

[root@flash ~]#pip3.7 install ssl
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting ssl
Using cached https://mirrors.aliyun.com/pypi/packages/83/21/f469c9923235f8c36d5fd5334ed11e2681abad7e0032c5aba964dcaf9bbb/ssl-1.16.tar.gz (33 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [19 lines of output]
Traceback (most recent call last):
File "/usr/local/python3.7b/python3.7/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/usr/local/python3.7b/python3.7/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/usr/local/python3.7b/python3.7/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-g8oqkn22/overlayb/python3.7/site-packagestuptoolsild_meta.py", line 341, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-g8oqkn22/overlayb/python3.7/site-packagestuptoolsild_meta.py", line 323, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-g8oqkn22/overlayb/python3.7/site-packagestuptoolsild_meta.py", line 488, in run_setup
self).run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-g8oqkn22/overlayb/python3.7/site-packagestuptoolsild_meta.py", line 338, in run_setup
exec(code, locals())
File "<string>", line 33
print 'looking for', f
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('looking for', f)?
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.

JJlin777的主页 JJlin777 | 初学一级 | 园豆:157
提问于:2023-04-23 14:53
< >
分享
最佳答案
1

看这个日志,你安装的ssl版本太低了,似乎是针对 python2的ssl。
错误日志里面的意思是 print 的写法不对,那个写法是python2的。

试试高版本的ssl能不能安装成功,现在python2已经不提倡使用了。

收获园豆:50
wang_yb | 老鸟四级 |园豆:4891 | 2023-04-23 17:22

嗯,那如果在python3里,是不是有ssl模块就可以使用了,
python3
import ssl
不报错的话,
不需要使用pip3安装ssl。

JJlin777 | 园豆:157 (初学一级) | 2023-04-23 18:23

@JJlin777: 是的,能import就说明已经有这个模块了

wang_yb | 园豆:4891 (老鸟四级) | 2023-04-25 13:15
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册