error: No module named pillow, requests or pywhatkit - python

pywhatkit, requests, and pillow are already installed in my system. But, during importing any one of these, ImportError occurs.
After installing it through jupyter notebook, I still got the same error.
Actually I am a student and a noob in this field, so you can underestimate me. and feel free to help.

I think you are using python 2 instead of python 3. This particular error happens to me too. I think it might help.

Installing via pip on your local won’t necessarily install it for the kernel in your jupyter notebook. I typically write something like %pip install {libraries_here} into a cell. After running that cell, I restart the kernel and the packages should be there.

Related

ModuleNotFoundError after installing PyUpSet

Reference: https://github.com/ImSoErgodic/py-upset
Hello! I have installed pyupset via both pip, pip3, and the source directly, as described in the link above. The terminal is saying that I have it completely downloaded. However, when I go to spyder and type "Import pyupset", I get the ModuleNotFoundError. After some research, it seems as though there's a discrepancy between the Python 3.8 library it is downloading to and the Python 3.9.5 I am using in Spyder, and that is the reason it doesn't show up. Does anyone know how to access the Python 3.8 downloads or generally have a way to access the script? I've also tried with a script updated for the recent Python iterations (https://github.com/jnothman/UpSetPlot) that does a similar function, but I'm getting the same error. Thank you!
Inside spyder try using import pip then run !pip install py-upset which should add it to your 3.9.5 environment.

ModuleNotFoundError: No module named 'sklearn.model_selection'; 'sklearn' is not a package

I have been dealing with this much too long. I am using a MacBook Pro. This suddenly started happening when running Jupyter. I could not fix it. I completely uninstalled anaconda (which was using Python3.8) then completely uninstalled Python3.9. I installed Python3.96. Then went back to basics and reinstalled numpy, pandas, sklearn. Everything seems to be there in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages
This command fails in IDLE and gives the error in the title of my question.
from sklearn.model_selection import train_test_split
It does not give the error in Mac's Terminal
The search path for IDLE looks correct.
You can use pip to install it.
And it's called scikit-learn instead of sklearn in pip, if you are using Jupyter, do
!pip install scikit-learn
If you already have it, try
!pip install --upgrade scikit-learn
So after a few weeks of simply using Googles Colab I did the following. Purchased App Cleaner and Uninstaller for Mac and got rid of all Python related apps that I do not need any more after moving to Colab and Kaggle's API. Removed and reinstalled Python. Ran the Idle program again and it worked! Yay!. The problem started while using Jupiter with Anaconda. Just randomly appeared. When I decided to work on it again yesterday I thought it might have been some malware on my Mac. The reason I thought it was malware is that the Idle message was giving me the message that sklearn was not a package and it could not find train_test split - even when I asked for another sklearn module - e.g. datasets. It always referred to train_test_split even when I did not request it. Hence the cleanup of my Mac (everything Python related and more). It's all good now.

ImportError: no module named sounddevice

Currently trying to use sounddevice in some code I am writing, but I keep getting the error mentioned in the title.
So far, I have tried installed sounddevice in all python versions I have, uninstalled and reinstalled it a few times, added this to the top of the code:
'#!/usr/bin/env python3'
Also, I have tried reinstalling rtmidi-python, pyaudio, cffi, and sounddevice all at once and each individually
I also have ran the pip freeze command and I get these results, which are some of the modules I am looking to try to install, and am having issue with all:
'cffi==1.14.2
PyAudio==0.2.11
sounddevice==0.4.0'
To my knowledge, PyAudio is a Python version of PortAudio (which is only for C++ and C), so in order to use PortAudio/PyAudio needs to be installed to use sounddevice.
Sidenote: Not sure if it is related, but I also keep getting told to upgrade pip, but I do have the most up to date version, and keep getting this error when installing something:
`Error initializing entry point('gnome','keyrings.alt.Gnome',None,Distribution('keyrings.alt','3.4.0'))`
Please let me know what else I can try to get this to work, I am still a beginner and am not quite sure how some of this works. Thanks!
I had a similar issue with the sounddevice lib:
I created a new virtual env in pycharm and installed sounddevice via pip. In the IDE everything worked fine but when i used pyinstaller to build and executable, i got an import error on startup. What helped me was deinstalling sounddevice with pip, updating/reinstalling pip and installing it again, similar to the comments under the original post.
Maybe this will help someone else :)

Installed required packages on the host system but facing missing packages issue in Jupyter Notebook

I have all the packages required to run the ipynb file on my computer, but while I run the notebook file, I get the error message 'No module named 'plotly'' (for example).
'plotly' has actually been installed on the system, and even if I install it in a previous step in the notebook file, I get the same error message.
I am not really sure if it is a problem with sync between the system and notebook file or I'm missing something really obvious here.
The same holds true many other packages and libraries.
Any help would be appreciated.
Indeed the problem was that most of the packages were installed, by default, for Python 2. I had to re-install all the packages separately for Python 3 (Jupyter Notebook).
pip install package-name
pip3 install package-name
Not all the packages are available for Python 3 but thankfully, all the ones I needed were easily obtained. Hope this helps someone and thank you all for the suggestions :)

Installing Anaconda and the modules not working

I have just installed Anaconda and then when I tried to use Idle to use the module statsmodels it tells me it doesn't exist:
ModuleNotFoundError: No module named 'statsmodels'
If I then try installing the module using pip it tells me its there.
I have also tried uninstalling Anaconda and installing the modules separately but the connection times out. error image
I am at work so could this be due to the pip module being unable to get through the proxy?
If that is the case why did Anaconda not seem to work either?
I am still unable to get the libraries working on Idle. But I have started using Spyder, which came with Anaconda and all the libraries are working there.
This is fine for my purposes. Though it would be good to know why?
Thanks
Have you tired installing the individual packages via pip? I am running into the same problem. It was working for some, not for others....

Categories

Resources