Noodles
Noodles

Reputation: 309

How to Install pycocotools through Conda

OS:windows 7

Python:Python 3.7.3

Conda:conda 4.8.2

Step1: download soucre code of pococtools from github with linker fellowing: https://github.com/philferriere/cocoapi

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' enter image description here

    Soluttion: pip install Cython

  2. Error: command 'cl.exe' failed:No such file or directory enter image description here

    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. enter image description here

enter image description here

Upvotes: 7

Views: 39369

Answers (7)

Krishnamoorthy P
Krishnamoorthy P

Reputation: 23

Try this it will work

conda install -c conda-forge pycocotools

Upvotes: 0

Darshan Bhanushali
Darshan Bhanushali

Reputation: 9

This worked for me:

 pip install pycocotools-windows 

Upvotes: 0

Sean Clement
Sean Clement

Reputation: 51

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+https://github.com/philferriere/cocoapi.git#egg=pycocotools^&subdirectory=PythonAPI

Upvotes: 3

Akash Prabhu
Akash Prabhu

Reputation: 159

This worked for me:

pip install pycocotools-windows 

Upvotes: 15

Vikram
Vikram

Reputation: 341

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.

Upvotes: 0

Leopd
Leopd

Reputation: 42757

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

conda install Cython
pip install pycocotools

Upvotes: 1

Joshua Clancy
Joshua Clancy

Reputation: 131

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.

Upvotes: 9

Related Questions