0

Following is the error produced when I try to install "mysql-connector-python" in pycharm. Any help would be great.

Non-zero exit code(1)

Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'C:\Users\karan.gupta\AppData\Local\Programs\Python\Python36-32\python.exe'.

Collecting mysql-connector-python
  Could not fetch URL https://pypi.python.org/simple/mysql-connector-python/: There was a problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748) - skipping

  Could not find a version that satisfies the requirement mysql-connector-python (from versions: )
No matching distribution found for mysql-connector-python
Karan Gupta
  • 499
  • 1
  • 5
  • 17

3 Answers3

1

Run pip install mysql-connector from your Terminal, as the error handler suggests. Or try to run the same command from wherever you've already tried, but without the -python at the end.

Milan Velebit
  • 1,604
  • 2
  • 10
  • 28
  • It says “pip is not recognised as internal or external command”. I need to switch to the directory where python is installed? – Karan Gupta Sep 26 '17 at 07:46
  • Which OS are you on? – Milan Velebit Sep 26 '17 at 07:48
  • I am on Windows 10 64 bit – Karan Gupta Sep 26 '17 at 07:49
  • Try running 'python -m pip install -U pip setuptools' , if that fails: https://bootstrap.pypa.io/get-pip.py – Milan Velebit Sep 26 '17 at 07:50
  • ython 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> pip install mysql-connector File "", line 1 pip install mysql-connector ^ SyntaxError: invalid syntax >>> python -m pip install -U pip setuptools File "", line 1 python -m pip install -U pip setuptools ^ SyntaxError: invalid syntax – Karan Gupta Sep 26 '17 at 07:51
  • Ok it ended and produced this: if __name__ == "__main__": ... main() ... Traceback (most recent call last): File "", line 2, in NameError: name 'main' is not defined – Karan Gupta Sep 26 '17 at 07:59
  • Try running 'py -m pip install mysql-connector', if this works I'll update my answer. – Milan Velebit Sep 26 '17 at 08:02
  • Nope :(. ` py -m pip install mysql-connector File "", line 1 py -m pip install mysql-connector` Its not recognizing pip – Karan Gupta Sep 26 '17 at 08:04
  • That's just odd, since you have Python 3.6 and all Python versions above 2.7 if I'm correct are automatically shipped with Pip installed. I can only refer you to [this link for more info.](https://stackoverflow.com/questions/4750806/how-do-i-install-pip-on-windows) You should really install pip first as you'll need it further on. – Milan Velebit Sep 26 '17 at 08:11
  • Yeah even I’m wondering...should I remove everything and re install? Maybe that’ll help – Karan Gupta Sep 26 '17 at 08:40
  • Go for it, we have to end the discussion here, we're breaking community standards, good luck. – Milan Velebit Sep 26 '17 at 08:43
0

Click here! Use MySQLdb instead, i used it and it's working fine. Method is in the blog. Hope it will help you

Mubi
  • 11
  • 3
0

I believe this version of the connector works only with python 2.7, if you try installing it with python 2.7 version, maybe it will work.

defcon
  • 103
  • 6