0

I am trying to Install MySQL Connector using "pip install mysql-connector-python" but it says that

Requirement already satisfied (use --upgrade to upgrade): mysql-connector-python in /Library/Python/2.7/site-packages 

I am using Python IDLE and i want to somehow install mysql-connector in IDLE`s modules directory and so MySQLdb.

How do i change the default directory which is /Library/Python/2.7/site-packages to the one used by IDLE?

Osama Yawar
  • 361
  • 2
  • 6
  • 19

1 Answers1

1

You best use virtualenv, and make IDLE work in a virtual environment. This way you can just install Connector/Python as usual.

Or you can install MySQL Connector/Python in a different folder and add it to the PYTHONPATH when launching IDLE:

shell> pip install --target=/tmp/myconnpy --allow-external mysql-connector-python mysql-connector-python
shell> PYTHONPATH="/tmp/myconnpy" idle

pip 1.4.1 has apparently problems using --target when the package is already installed system-wide, even using --ignore-installed. So you'll need to remove the package first first.

Community
  • 1
  • 1
geertjanvdk
  • 3,440
  • 24
  • 26