How to Install Pycocotools Through Conda
  • Enviroment

OS:windows 7

Python:Python 3.7.3

Conda:conda 4.8.2

Step1: download soucre code of pococtools from github with linker fellowing:

Step2: build & install pococotall package by running

python setup.py build_ext --inplace,

python setup.py build_ext install 

sequently.

  1. ModuleNotFoundError:No modul named 'Cython'

    Soluttion: pip install Cython

  2. Error: command 'cl.exe' failed:No such file or directory

    Solution: install Visual Studio 2019 and ensure install 'Desktop development with c++' enviroment.

After deal with all probelem,you can run the two instrustion to finish the installment.You can run

conda list

and then check pycocotools.

6 Answers

This worked for me:

pip install pycocotools-windows 

Following the same steps as specified here:

  • Install Visual C++ 2015 Build Tools from here with default selection.

  • Go to C:\Program Files (x86)\Microsoft Visual C++ Build Tools and run vcbuildtools_msbuild.bat

  • In Anaconda, run

  • pip install git+

0

I just went down this list until I found one that worked:

conda install -c conda-forge pycocotools
conda install -c conda-forge/label/gcc7 pycocotools
conda install -c conda-forge/label/cf201901 pycocotools
conda install -c conda-forge/label/cf202003 pycocotools

Annoyingly, it seems that for some setups pycocotools will install just fine. But then, when you want to import it, the script will freeze at the import step. In that case, just go down the list and try the next one.

The last one (and most recent) worked for me, so perhaps start there.

1

If you don't mind using conda & pip together, this worked for me:

conda install Cython
pip install pycocotools

Conda seems to have issues with pycocotools installations ,official link dosent mention windows. You may want to look into this solution on github for pycoco installation on windows. Worked for me. Better to use the pypi for installation.

This worked for me:

 pip install pycocotools-windows 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest