Install MYSQLDB problems encountered.
Mac Version number: 10.11.6
Perform python2.7 setup.py build
Error:
urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)>
The error code is 590
The data found on the Internet is that Mac computers have many versions of Python, some of which are also caused by OS system.
Validation phase:
1. Directly using Python setup.py build, no problem, direct operation succeeded. Troubleshooting OS System Issues
2. The reason for the Internet search is the problem of SSL authentication, then try to solve
3. According to the error information to find the Urllib2 file, mine is under the/opt/local/library/frameworks/python.framework/versions/2.7/lib/python2.7 folder
4. Open urllib2.py, add the following code to the import SSL, and save
Ssl._create_default_https_context = Ssl._create_unverified_context
5. Try to re-execute the python2.7 setup.py build successfully.
When importing the SSL module, turn off the certificate verification.
One is global, one is not
Guess you're going to have to use the global
Import SSL
Ssl._create_default_https_context = Ssl._create_unverified_context
Reference: http://tieba.baidu.com/p/3596194843
python2.7 installation MySQLdb