20

I have some problems with python 3 module installing. I'm trying to install mysql using pip :

python -m pip install mysql

for python 3.4.4 and here is the error I get:

error: command 'C:\\Program Files (x86\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2

here is a screenshot : screenshot of the error message

I had other problems with module installation before, and I solved those by installing Visual Studio C++ 2010

Btw, the installation of other modules are working just fine.

My specs : Windows 10 x64

Python 3.4.4 x86

10
  • Please provide the full error message! Like here (maybe, it is related stackoverflow.com/q/10773732/1566267) Commented Apr 2, 2016 at 19:30
  • Run this file in the command line (admin): C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat It will configure environment variables for using MSVC Compiler in command-line builds. Commented Apr 2, 2016 at 19:34
  • I added a screenshot of the full error message Commented Apr 2, 2016 at 19:45
  • "Run this file in the command line (admin): C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat It will configure environment variables for using MSVC Compiler in command-line builds. " This didn't solve my problem Commented Apr 2, 2016 at 19:47
  • Ok, then see that stackoverflow.com/q/26866147 Commented Apr 2, 2016 at 19:47

4 Answers 4

1

Do you have Connector installed? (See also here)

Download it here and install.

It can be due to you have x64 Windows, but mysql wants files to be in "Program Files (x86)" directory:

mklink /d "C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" "C:\Program Files\MySQL\MySQL Connector C 6.0.2\include"

If won't help, try other answers from that post

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

Comments

1

I had this problem and I can solve it in PyCharm (version: 2019.2) as follow:

  1. update the pip version in pycharm (at this time the latest version of pip is 20.0.2):

    1-1- Open project settings (File > Settings...) (preferences on Mac)

    1-2- Project > Project Interpreter

    1-3- Press the + button

    1-4- Type pip in the top search box

    1-5- In the lower right corner choose specify version and ensure using latest version

    1-6- press Install Package button

you can also find out the current version of pip through cmd in windows by this command: pip -V and then update pip by this command: pip install --upgrade pip

2- Go to File > Settings... > Project > Project:Interpreter and update pip by clicking on upgrade button as the following picture (click on the small upward arrow at the right sidebar): enter image description here

3- Like the first step, install latest version of matplotlib (at this time its latest version is 3.2)

Comments

1

I was trying to install Pycocotools into my environment. I had the same error.

It got resolved by doing the following steps:

  1. Install Visual Studio 2019 which gives the paths C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\cl.exe and C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe

  2. Go to Mask_RCNN, type cd Mask_RCNN

  3. In Anaconda Prompt, type pip install pycocotools

  4. Install Clone of COCO, type pip install git+https://github.com/philferriere/cocoapi.git#egg=pycocotools^&subdirectory=PythonAPI

You'll get the following: enter image description here

  1. Open Jupyter notebook by typing jupyter notebook

Comments

0

Go to this site and download whl file (for example python3.7 and win64 should use mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl).

Then run this command:

python -m pip install C:\Users\%USER%\Desktop\mysqlclient-1.3.13-cp37-cp37m-win_amd64.whl

Comments

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.