3

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.

1 Answer 1

14

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

Sign up to request clarification or add additional context in comments.

4 Comments

python 3.6 ubuntu 14.04
Similarly I was using the schedule package pypi.org/project/schedule. Importing mysql.connector first and schedule later worked.
There is some possibly related information at this link bugs.mysql.com/bug.php?id=97220
Same issues I am facing. Thanks for solution. This also work for me :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.