mchd
mchd

Reputation: 3163

Installing OpenCV into PyCharm

Idk if this is a stackoverflow-appropriate post so forgive if the question is misplaced. I'm trying to install OpenCV into my Pycharm IDE through the conda virtual environment. I typed conda install -c conda-forge opencv inside the PyCharm terminal and it has been doing this for 11 hours and God knows how many more to go.

enter image description here

Pycharm did this with PyTorch as well. Am I doing something wrong or is this normal?

Upvotes: 0

Views: 753

Answers (1)

Morris Franken
Morris Franken

Reputation: 2555

While you can install packages directly in PyCharm by going to file->settings select Project Interpreter and click on the '+' icon on the top right (see image) enter image description here I would recommend creating a requirements.txt file in the root of your project, and write down all your required packages. When a package is missing, PyCharm will automatically suggest to install the package for you.

e.g. for installing opencv you can add the following to you requirements.txt

opencv-python

Or even specify the version that your project needs

opencv-python==4.1.2

edit: the advantage of using a requirement.txt is that you can more easily port the project to another machine, and re-install the packages if needed.

Upvotes: 1

Related Questions