Unable to install openpifpaf and pycocotools with pip. ERROR: Failed building wheel for openpifpaf/pycocotools

1.4k Views Asked by At

Configuration:

  • macOS 10.14
  • Python 3.7.1

I am trying to install pycocotools and openpifpaf by issuing this command that should install openpifpaf and pycocotools:

pip3 install 'openpifpaf[train,test]'==0.5.2

as it is mentioned in my project work.

I looked at previous similar questions and tried to update setuptools and wheels, it did not help.

Basically the final message error are:

ERROR: Failed building wheel for pycocotools 

ERROR: Failed building wheel for openpifpaf

I can provide more details on the error if necessary, I have no idea of how to fix it.

2

There are 2 best solutions below

2
svenkreiss On

pycocotools is a bit special. It requires pre-installed Cython and numpy and pure pip cannot handle an order in the dependencies. You have to run pip3 install numpy cython before you can install openpifpaf with the train dependency.

I hope you find openpifpaf useful. Feel free to open an issue for this kind of question; I would have seen that earlier.

0
tamtam On

I had the same error for when I tried pip install pycocotools to my virtual environment venv. Installing pycocotools has other package dependencies - I'm not sure which exactly but it's among these here which are installed in venv. Probably just numpy and cython are necessary, but I haven't tested that.

Make these dependencies findable by adding venv to the PYTHONPATH in ~./bash_profile:

export PYTHONPATH="${PYTHONPATH}:path/to/venv"