Pipenv: how to use pipenv with cv2

Created on 17 Jan 2018  路  4Comments  路  Source: pypa/pipenv

I install OpenCV by brew install opencv. To import cv2, copy the cv2.so from opencv lib to my python sitepackages. When I use pipenv, how do I install the cv2?

environment

  • MacOS Sierra
  • Python3.6
  • pipenv, version 9.0.1

Most helpful comment

$ brew install opencv
$ pipenv --python 3.6
$ pipenv install numpy
$ ln -s "$(brew --prefix)"/lib/python3.6/site-packages/cv2*.so "$(pipenv --venv)"/lib/python3.6/site-packages
$ pipenv run python -c "import cv2; print(cv2.__version__)"
3.4.0

And I鈥檒l mention #1305 because the issue tracker is not the place for usage questions.

All 4 comments

$ brew install opencv
$ pipenv --python 3.6
$ pipenv install numpy
$ ln -s "$(brew --prefix)"/lib/python3.6/site-packages/cv2*.so "$(pipenv --venv)"/lib/python3.6/site-packages
$ pipenv run python -c "import cv2; print(cv2.__version__)"
3.4.0

And I鈥檒l mention #1305 because the issue tracker is not the place for usage questions.

@uranusjr thanks!

How to install on windows?

Follow the official documentation, but replace C:\Python27 with whatever pipenv --venv outputs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jacek-jablonski picture jacek-jablonski  路  3Comments

marc-fez picture marc-fez  路  3Comments

konstin picture konstin  路  3Comments

bgjelstrup picture bgjelstrup  路  3Comments

jeyraof picture jeyraof  路  3Comments