Python error: command '…\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2

后端 未结 4 663
攒了一身酷
攒了一身酷 2020-12-15 19:14

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

相关标签:
4条回答
  • 2020-12-15 19:45

    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

    0 讨论(0)
  • 2020-12-15 19:54

    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)

    0 讨论(0)
  • 2020-12-15 20:03

    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
    
    0 讨论(0)
  • 2020-12-15 20:06

    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
    0 讨论(0)
提交回复
热议问题