Reputation: 31
Actually I am using Ubuntu 16.04 and python3 so in that when I am importing MySQL.connector and CGI in a single file the file is not working showing the error
#!/usr/bin/python3
import cgi
import mysql.connector as msql
Segmentation fault (core dumped).
These both are not working simultaneously but working individually.
Upvotes: 3
Views: 1874
Reputation: 451
I don´t know why but in my case changing the order on imports solved the problem
With this imports:
import sys, pdfplumber, json, io, re, getpass
import mysql.connector as mariadb
I get Segmentation fault (core dumped)
I changed the imports order letting mysql.connector first
import mysql.connector as mariadb
import sys, pdfplumber, json, io, re, getpass
And my script ran flawlessly
It took me whole day to solve it.... hope it helps
Upvotes: 14