CA Burns
CA Burns

Reputation: 111

Unable to run import scikit-image in jupyter notebook despite successful installation of scikit-image in Anaconda

First, I'm a Windows user. There's a a conflict between Skimage and Tensorflow installs. Each installs ok but they don't run when installed in the same environment. I did " pip install scikit-image" and the computer says it's already installed. When I ran import skimage.data in jupyter notebook, I keep getting the error "no module named skimage" although I have scikit-image installed.enter image description here

Upvotes: 2

Views: 5721

Answers (3)

KWC
KWC

Reputation: 119

I finally brew uninstall miniconda. Install the whole Anaconda (with the scikit-image built-in) and it worked. Not that the path I like to take. But that solve my issue for the moment.

Upvotes: 0

Matthew Gallegos
Matthew Gallegos

Reputation: 71

Creating a conda virtual environment, and installing scikit into it, does not mean that it will be available to the ipython kernel in Jupyter notebook. You need to do a few more things to sync everything up.

iPython documentation states

The Jupyter Notebook and other frontends automatically ensure that the IPython kernel is available. However, if you want to use a kernel with a different version of Python, or in a virtualenv or conda environment, you’ll need to install that manually

Try the following:

Create and activate a python environment

conda create -n py371 python=3.7.1 anaconda
conda activate py371

Install pip and ipykernal

We do this so that we can link the Jupyter Notebook Kernel to the newly created virtual environment "py371"

conda install pip
conda install ipykernel # or pip install ipykernel

Link the new virtual environment to ipykernel

We link the newly created virtual environment "py371" to the ipykernel so Jupyter Notebook can see it

python -m ipykernel install --user --name py371 --display-name "Python (Python 3.7.1)"

Install whatever packages you need, in this case, scikit-image, tensorflow, etc...

conda install -c conda-forge scikit-image

Launch Jupyter Notebook

jupyter notebook

You will now see your new Kernel linked up in Jupyter Notebook

Select the new kernel (Python 3.7.1). Your code will now execute against the selected kernel, which you also linked to your conda virtual environment.

Jupyter Notebook - Virtual Environment - Conda - Kernel Setup

Further reading and info can be found here: Managing Python Installing the IPython kernel

Upvotes: 4

Blue Bird
Blue Bird

Reputation: 318

I suggest a Microsoft’s way for you are using Anaconda in windows.

Open Anaconda Navigator

You can find your installed and Not-installed packages. You can reinstall them. enter image description here

Upvotes: 0

Related Questions