简体   繁体   English

尝试安装程序时,python 上的 ssl 证书验证失败

[英]ssl certificate verify failed on python when trying to install a programme

I have almost no coding experience and am trying to install some software on my mac (osX Yosemite).我几乎没有编码经验,正在尝试在我的 mac (osX Yosemite) 上安装一些软件。 The software os the FSL package to virtually visualise neuroanatomy.该软件使用 FSL 包来虚拟可视化神经解剖学。 The instructions for installing it can be found at https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FslInstallation/MacOsX Whenever I try to install it i get the code安装说明可以在https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FslInstallation/MacOsX每当我尝试安装它时,我都会得到代码

olegs-MacBook-Air-4:Downloads Sonya$ cd ~/Downloads
olegs-MacBook-Air-4:Downloads Sonya$ python fslinstaller.py
--- FSL Installer - Version 3.0.11 ---
[Warning] Some operations of the installer require administative rights,
    for example installing into the default folder of /usr/local.
    If your account is an 'Administrator' (you have 'sudo' rights)
    then you will be prompted for your administrator password
    when necessary.
When asked a question, the default answer is given in square brackets.
Hit the Enter key to accept this default answer.

[FAILED] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726)
olegs-MacBook-Air-4:Downloads Sonya$

Really don't know what to do about this, any help would be appreciated真的不知道该怎么办,任何帮助将不胜感激

UPDATE I've just tried the same command again and have now got the code更新我刚刚再次尝试了相同的命令,现在已经得到了代码

olegs-MacBook-Air-4:~ Sonya$ cd ~/Downloads
olegs-MacBook-Air-4:Downloads Sonya$ python fslinstaller.py
--- FSL Installer - Version 3.0.11 ---
[Warning] Some operations of the installer require administative rights,
    for example installing into the default folder of /usr/local.
    If your account is an 'Administrator' (you have 'sudo' rights)
    then you will be prompted for your administrator password
    when necessary.
When asked a question, the default answer is given in square brackets.
Hit the Enter key to accept this default answer.


[FAILED] nodename nor servname provided, or not known

Not sure if you're still having trouble, but I think your problem may be the same as this one不知道,如果你仍然有问题,但我认为你的问题可能是相同的这一个

The solution is to change python fslinstaller.py to /usr/bin/python fslinstaller.py .解决方案是将python fslinstaller.py更改为/usr/bin/python fslinstaller.py

If this doesn't work it may be the full path to your python is wrong.如果这不起作用,则可能是您的python 的完整路径错误。 You can find the right one with which python , which python2 , or which python2.7 .您可以通过which pythonwhich python2which python2.7找到正确的选项。 One of these will probably work其中之一可能会起作用

In my case I needed to run the command sudo /usr/bin/python2.7 fslinstaller.py and the installer worked在我的情况下,我需要运行命令sudo /usr/bin/python2.7 fslinstaller.py并且安装程序工作

import ssl
ssl._create_default_https_context = ssl._create_unverified_context

Put this code on the top of fslinstaller.py and run python fslinstaller.py .将此代码放在 fslinstaller.py 的顶部并运行python fslinstaller.py In my case it worked.就我而言,它起作用了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM