spyder ModuleNotFoundError: No module named 'sklearn' - pandas

This error is coming when i am trying to import Sklearn in Spyder IDE. But it is running smoothly on python 3.11 terminal if i am trying to install in by pip install Sklearn its showing:
enter image description here
on Spyder ide its showing :
enter image description here
This on importing sklearn.
on python3.11 it is not giving any error:enter image description here
how can I fix this issue?

Related

Cannot import name 'to_html' from 'pandas_profiling.report' using JupyterLab

I'm new using Jupyter Lab and Pandas profiling.
I'm trying to install and import and install Pandas Profiling in a jupyter notebook. I'm able to install pandas collab using pip, but unable to import the library. The error says I cannot import name 'to_html' from 'pandas_profiling.report'.
Here's the code and the error.
Funny thing is: I also tried to run the notebook in Google Colab, but I got a different but similar error:
ImportError: cannot import name 'PandasProfiling' from 'pandas_profiling' (/usr/local/lib/python3.8/dist-packages/pandas_profiling/__init__.py)
I already tried to use Jupyter Lab and Jupyter Notebook from Anaconda and Google Colab to see if it works, but no look.
conda install -c conda-forge pandas-profiling
See this question.
from pandas_profiling import ProfileReport
https://pandas-profiling.ydata.ai/docs/master/pages/getting_started/quickstart.html
PandasProfiling object does not exist.

getting error importing spacy in my jupiter notebook

i have pip installed spacy it's already there, but when I import it I get error
Here is a screenshot for details

No module named 'stable_baseline3' even when it is installed in google colab

I am trying to set up stable baselines 3 in google colab. The document is connected to a local runtime on my pc through jupyter notebooks. On my pc i have installed stable baselines 3 using anaconda, and got the output saying essentially stable baselines 3 is installed. I have also run the cells:
!pip install stable-baselines3[extra]
!pip install stable-baselines3
and
!pip install stable-baselines3 --upgrade
Despite this, when i run the cell:
import stable_baseline3
from stable_baselines3 import DQN
etc...
I get the error on line 1 of ModuleNotFoundError: No module named 'stable_baseline3'. I dont understand why this would be happening, does anybody know how it could be solved?
i had the same problem
try to import stable-baselines3 first in alone cell and it should work
!pip install stable-baselines3

problems when importing tensorflow in Jupiter Notebook

I am using Jupiter Notebook installed with Anaconda distribution and I want to install Tensorflow.
I wrote
!pip install tensorflow
it installed it, but now when I want to import tensorflow, when I type
import tensorflow as tf
it gives me an error:
ImportError: DLL load failed with error code -1073741795
I searched for answers and questions related to this issue but nothing helped me. The most weird is that I managed to install and import tensorflow on another computer like this. I can`t find out what I am missing.

ipython cannot search matplotlib while using tensorflow and jupyter also has import error

I am using python 2.7 in Ubuntu and recently updated tensorflow 0.12.1.
I installed jupyter today for my sample code of tf and I need to use matplotlib. It does not find module name matplotlib and ipython in tensorflow has same error.
1. How can I set path in virtualenv or ipython or jupyter?
After activate tensorflow, I need to use jupyter notebook.
This below in the script for error does not work.
import sys
sys.path.append('my/path/to/module/folder')
import module-of-interest
2. other information: My environments are below.
mickyefromsd#DEKSTOP~$source ~/tensorflow/bin/activate
When I find matplotlib by python script under TF condition and before TF activation, it has below;
/usr/lib/python2.7/dist-packages/matplotlib/
When I type 'which ipython', it has below (not by /usr/bin/ipython) ;
/home/mickeyfromd/tensorflow/bin/ipython
Btw, /tensorflow/lib/python2.7/site-packages/ it has ipython and jupyter.
(not in the same path of matplotlib)
3. My ipython under TF cannot find my existing matplotlib.
(tensorflow) mickeyfromd#DK-DESKTOP:~$ ipython
Python 2.7.11+ (default, Apr 17 2016, 14:00:29)
In [1]: import matplotlib ImportError: No module named matplotlib
4. I wanted to setup virtualenv, so I just run this
I followed this site. site:http://help.pythonanywhere.com/pages/IPythonNotebookVirtualenvs
(tensorflow) mickeyfromd#ipython kernelspec install-self --user
.....
Installed kernelspec python2 in /home/mickeyfromd/.local/share/jupyter/kernels/python2
(tensorflow) mickeyfromd#DK-DESKTOP:~$
I cannot move the the folder (in the second step)
How can I make ipython to have path for Matplotlib?
That import error is due to change in environment of the jupyter notebook. You might have installed the packages in one environment and you are running the jupyter notebook in another environment.
I have got two environments (envs) in my Anaconda folder ( I have Anaconda3 folder to be specific ).
(windows key+cmd ) -> open the windows command prompt run as administrator.
Activate (name of the environment) -> eg.: activate tensorflow-gpu
Start installing packages using conda install
Note: For each environment you need to install all the packages you want to use, separately using the same process. This solution is for windows users, might work for linux users not sure though.
Additionally to make sure your conda environment is up to date run:
conda update conda
conda update anaconda
check this out : https://pradyumnamajumder.wordpress.com/2017/09/30/solution-to-the-python-packages-import-error-in-jupyter/