0
sudo easy_install pip

I used its code and it loaded successfully.Then I opened visual studio on the terminal

pip install mysql-connector

I used the code, but it gives an error

ImportError: No module named typing

please help

Bart
  • 1
  • 3

1 Answers1

0

use

pip install mysql-connector-python

and in your code

import mysql.connector
nbk
  • 45,398
  • 8
  • 30
  • 47
  • i run python 3.94 and run the pip again. but it is alt´ready installed, try to update pip – nbk May 07 '21 at 17:24
  • i run the code also in the terminal of vs code. the same result – nbk May 07 '21 at 17:25
  • try also https://stackoverflow.com/questions/24272223/importerror-no-module-named-mysql-connector-using-python2 or there are a lot more mysql conmctor like pymaysql and other try your luck with them – nbk May 07 '21 at 17:29
  • where else can I use mysql connector – Bart May 07 '21 at 17:30
  • first try the link in the comment and then https://stackoverflow.com/questions/372885/how-do-i-connect-to-a-mysql-database-in-python – nbk May 07 '21 at 17:32
  • pip does not update "from typing import List, Optional ImportError: No module named typing" returns error – Bart May 07 '21 at 17:33
  • pythona brings already pip withit, so i don't know,why you need another, but run the pip command from a terminal – nbk May 07 '21 at 17:37
  • I know it is, but visual studio also says that pip was not found when I did "pip install mysql-connector" – Bart May 07 '21 at 17:42
  • try pip install pymysql when that alsp fails you have a problem that maybe superuser can help you with – nbk May 07 '21 at 18:07
  • do I need to write "pip install pymysql" to the terminal – Bart May 07 '21 at 18:16
  • i have a seperate terminal but you can use also the terminal in vs code, both do work – nbk May 07 '21 at 18:29
  • can I use jupyter notebook? – Bart May 07 '21 at 18:37
  • i don't know,. if it has atgerminal why not give it a try, but is answered because i use vs cpde and python – nbk May 07 '21 at 19:01
  • thank you for helping me and answering the questions that remain in my mind, I hope I get out of this :) – Bart May 07 '21 at 19:07