How can I find python library path?

Viewed 454

I am trying to find my openCV library path. I am pretty sure it is existing. When I run command panel on desktop to learn openCV version, I can see version of openCV. Here the result: enter image description here

I guess my base interpreter path is : enter image description here

But I couldn't find openCV library in this file. I want to use my base interpreter for another project which in another file. So I need to find openCV library is there. How can I find my openCV library path?

Also when I try to install openCV from pycharm>settings>interpreter>... , after installation cv2.version not working on desktop. I don't understand what is happening between this virtual environtments and base interprater.

2 Answers

here is an example

>>> import numpy
>>> numpy.__file__ 

check out here

If you are working in an enviroment always activate environment to install packages within the environment.

$ conda activate xxx
$ conda install -c conda-forge opencv

To find the interpreter, first activate your environment, run python and check the interpreter executable path.

$ conda activate xxx
$ python
>>> import sys
>>> sys.executable

If you haven't created an environment then execute below commands on cmd.

$ python
>>> import sys
>>> sys.executable
Related