0

I installed miniconda and just created a conda environment:

conda create -n my_env python=3.5 anaconda

I am trying to:

import cvlib

But I am getting the error:

ImportError: No module named cvlib

So I have tried to install using:

pip3 install cvlib

This seemed to work successfully, but then when I try to import cvlib I am still getting the ImportError: No module named cvlib error (I have retarted my terminal after the installation).

Is this a problem with my PYTHONPATH not containing the path to the directory that now contains cvlib? If so, how do I find where cvlib is saved so that I can add the path?

user1551817
  • 6,693
  • 22
  • 72
  • 109

2 Answers2

0

Check if the library is in your python directory. Otherwise, make a repl.it account, and install cvlib, and check the functions or the lib name. Maybe try searching a more advanced installation of cvlib.

user1551817
  • 6,693
  • 22
  • 72
  • 109
codernaut1
  • 39
  • 7
  • Thanks. What do you mean by "check if the library is in your python code"? – user1551817 Sep 22 '20 at 10:54
  • 1
    oops, typo, i meant to say your python directory. I'm sure its in your py directory in libs somewhere? it should be where all your packages are. – codernaut1 Sep 22 '20 at 10:55
  • So I did `import sys` and `print(sys.executable)` to find the pythong directory: `/home/me/miniconda3/envs/my_env/bin/python`. But this is not a directory apparently. So how can I check? Thanks! – user1551817 Sep 22 '20 at 11:02
  • 1
    im not familiar with miniconda, but look for a directory like python3.6.1. **This should be where your compiler is**. otherwise, srry dunno how to help ;c – codernaut1 Sep 22 '20 at 11:05
  • Hi! I think every compiler, interpreter and env has a lib folder. Look for one, and install cvlib there. I think then it should work. If it doesn't, I'd suggest a good read of the installation guide. – codernaut1 Dec 17 '20 at 20:24
0

it might have occurred due to the version of python you installed or due to the directory, you installed.

try uninstalling the current version of python and try installing an older version of python and install it in the directory as shown below:

C:\Users\Rajish\AppData\Local\Programs\Python\Python39

also, select add the path to environment variables while installing

and after that install cvlib and all other required modules and packages

it worked for me.