I have installed dlib using Anaconda 3 prompt.
It has shown me that it got installed successfully. I checked through command import dlib it did not give me any error even I checked the version also it came up with 19.9.0.
But when I open my program in IDLE and run the program its showing me error
import dlib ModuleNotFoundError: No module named 'dlib'
Even from command prompt, I am getting same error.
What is the issue? I am using Python 3.6.
Installation process of dlib using anaconda3:
You have installed the package in different version of python and importing the package in other version of the python.
Package is installed. in virtual environment(3.6.8) and is being imported in standard system python (3.6.0).
So either you need to use this virtual environment for your application otherwise you will need to install the package into global system python.
Extending #Rohit's answer:
As you have installed dlib in Anaconda, you need to run the program using Anaconda prompt.
By default, IDLE and python command in command prompt use Python that is installed system wide (which is Python 3.6.0 in your case).
But to use dlib which is installed in Anaconda's virtual environment (env_dlib) you need to do:
Open Anaconda prompt.
Activate env_dlib environment: activate env_dlib
Run the Python file which uses dlib package: python FILENAME
Related
Did pip install pdfrw, uninstalled and reinstalled, restarted my laptop, but still unable to import the specified package as it returns error: No module named 'pdfrw'.
https://pypi.org/project/pdfrw/#pdfrw-philosophy
Any advice is appreciated.
Update: Tried installing by cmd, I'm using Jupyter Notebook as IDE :)
You have to make sure that the Python that you are using with Jupyter Notebook is the same that the one for which you are installing that package. If you have several Python interpreters installed or if you installed Ananconda to use Jupyter, you have to take care of which pip are you invoking from CMD.
If you are using Jupyter from Ananconda, try to install the package using conda.
conda install pdfrw
Another thing that you can do is open a Command Prompt and type:
where python
you will get the path to the interpreters that you have installed. In my case I get:
>>> C:\Windows\system32>where python
C:\Python39\python.exe
C:\Python38\python.exe
>>> C:\Windows\system32>where pip
C:\Python39\Scripts\pip.exe
C:\Python38\Scripts\pip.exe
Then you can use a concrete interpreter to call pip, in my case I will do:
C:\Python39\python.exe -m pip install pdfrw
After the installation finish, invoke the same interpreter you use to call pip:
C:\Python39\python.exe
Then try to import pdfrw. If you can import it, then the problem is that you are using a different interpreter in Jupyter Notebook.
I first installed Spyder and then afterwards Python on a server (with Windows Server 2019) all on the directory "C:\Users\wi932\ .spyder-py3" and the Python folder "C:\Users\wi932\Python\Python38". Then I installed many packages (like tensorflow, matplotlib, scikitlearn) by using the command prompt of windows and pip from the directory "C:\Users\wi932\Python\Python38\Scripts" and it was okay.
However, when running Spyder I can't use the packages that I installed using pip. Whenever I run a Python programm with those modules I get an error message "ModuleNotFoundError: No module named 'tensorflow'". So the question is how can I build a "connection" between the pip and Spyder?
Does anyone have an idea? I'll appreciate every comment.
Have you considered installing anaconda?
Spyder comes as a part of this and is easy to install from the anaconda client. You can also create your base environment in the anaconda client and then switch to pip to install packages from there.
I have successfully installed textract module using pip install textract on windows 10 after following these steps, but when i try to import textract(using Spyder IDE python 3.6.10 anaconda), i get ModuleNotFoundError: No module named 'textract'.
In command prompt when i enter the pip list command, i can see the mentioned module version 1.6.3, but when i enter conda list i can't find it.
I have added the paths in the system environment variables for conda, and also for pip.
I am new to python, did i miss anything? or is it that i can't import modules installed from pip and it should be installed with conda?
I'm trying to install dlib on my raspbian and I am having a lot of problems. Well this is not real at all beacuse theoretically it's installed.
I have a virtual environment and it's installed with opencv-python, when i am in this virtual environment and I execute python if I write import dlib there is no problem. But if I run a .py file previously writted says the error
import dlib
ImportError: No module named 'dlib'
Why this is happening? I've been thinking maybe there is a conflict of versions, python2 or python3, but I don't know. In this case I'm using python 3.5.
I have successfully installed opencv and dlib in my windows pc following this site:
https://www.learnopencv.com/install-opencv-3-and-dlib-on-windows-python-only/
I have checked the version of opencv and dlib in cmd which make me sure that these libraries are installed in my windows pc.
Version checking in CMD
Now I open spyder which was installed by anaconda as default and I imported cv2 and dlib. But it gives error as no module named cv2 found, no module named dlib found.
Which step am I missing here? I am just a starter in programming world. Thanks for your help in advance.
You must run Spyder in the same virtual env as you are running your Python instance, in the screenshot.
You can do that by first installing Spyder in the virtual env, like so,
activate opencv-env
conda install spyder
and then calling the spyder executable from the same console.
That should do the trick.