1

I'm trying to connect to a mySQL server through python on a MacBook Pro, and I need to pip install mysql to continue. However when I run that command I get the following error:

ModuleNotFoundError: No module named 'ConfigParser'
---------------------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/jc/cn0mjt8s13jfb9w3f42qy27c0000gn/T/pip-install-viy629s3/MySQL-python/

Any ideas on how to get pass this would be greatly appreciated.

tmcdo13
  • 31
  • 4
  • `brew install mysql` maybe will help – Druta Ruslan May 22 '18 at 15:47
  • Which python version are you using ? –  May 22 '18 at 15:47
  • Possible duplicate of [Python 3 ImportError: No module named 'ConfigParser'](https://stackoverflow.com/questions/14087598/python-3-importerror-no-module-named-configparser) – vasia May 22 '18 at 15:49
  • I believe I am using python3. – tmcdo13 May 22 '18 at 15:49
  • `ConfigParser` was renamed to `configparser` in python3, if you install it for python2, it works just fine. `python2 -m pip install mysql`. Seems like mysql client is not supported by python3 if this is the case. – vasia May 22 '18 at 15:50
  • @vasia, I got this: -bash: python2: command not found – tmcdo13 May 22 '18 at 15:52
  • also brew intall mysql got this: Error: Failure while executing: git config --local --replace-all homebrew.analyticsmessage true – tmcdo13 May 22 '18 at 15:53
  • what is the output of `ls -la | grep python`? – vasia May 22 '18 at 15:57
  • @vasia, drwxr-xr-x 5 tmcdo13 staff 170 May 14 11:01 .ipython -rw------- 1 tmcdo13 staff 12 May 22 10:52 .python_history – tmcdo13 May 22 '18 at 15:59
  • sorry, my mistake, I meant to ask for the output of `ls -la /usr/bin | grep python` – vasia May 22 '18 at 16:02
  • -rwxr-xr-x 1 root wheel 66736 Jul 8 2016 python -rwxr-xr-x 5 root wheel 925 Oct 23 2015 python-config – tmcdo13 May 22 '18 at 16:07
  • lrwxr-xr-x 1 root wheel 75 Jan 20 2016 python2.6 -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6 – tmcdo13 May 22 '18 at 16:07
  • lrwxr-xr-x 1 root wheel 82 Jan 20 2016 python2.6-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6-config lrwxr-xr-x 1 root wheel 75 Jan 20 2016 python2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 – tmcdo13 May 22 '18 at 16:07
  • lrwxr-xr-x 1 root wheel 82 Jan 20 2016 python2.7-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config -rwxr-xr-x 1 root wheel 66736 Jul 8 2016 pythonw lrwxr-xr-x 1 root wheel 76 Jan 20 2016 pythonw2.6 -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/pythonw2.6 lrwxr-xr-x 1 root wheel 76 Jan 20 2016 pythonw2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7 – tmcdo13 May 22 '18 at 16:07
  • @vasia, sorry for the weird response. I couldn't fit it all into one comment. – tmcdo13 May 22 '18 at 16:08
  • okay, so you have python2 installed, and you have both 2.6 and 2.7 You probably want to use 2.7, so to install `mysql` you could run `python2.7 -m pip install mysql` – vasia May 22 '18 at 16:12
  • It's saying "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No module named pip", but I've used it before? – tmcdo13 May 22 '18 at 16:13

0 Answers0