I've tried installing seaborn under anaconda on my mac. I've tried following many different instructions.
It installs with no problem but "import seaborn" fails.
I'm using Python 2.7 here. It will work for me under Python 3 but unfortunately I'm taking a course in which the notebooks are Python 2.7.
import seaborn
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-085c0287ecb5> in <module>()
----> 1 import seaborn
ImportError: No module named seaborn
Related
I'm trying to execute bayesian optimizer but I always get the same error.
I tried "pip install -U colorama" but it still doesn't work
ImportError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_13036\1140567575.py in <module>
----> 1 from colorama import just_fix_windows_console
2 just_fix_windows_console()
ImportError: cannot import name 'just_fix_windows_console' from 'colorama'
I had the same issue. For me, the following worked:
pip install colorama=0.4.4
pip install bayesian-optimization=1.4.0
I am currently using Amazon Deep Learning AMI (Ubuntu) Version 2. It comes with major deep learning framework (such as tensorflow, theano, etc) installed.
In console, I am able to import theano, tensorflow and others.
However, when I open jupyter notebook, I can't import import them.
It gives the following error.
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-4-4c17dd4059b8> in <module>()
----> 1 import Theano
ModuleNotFoundError: No module named 'Theano'
Does anybody know what is the problem?
could you try latest DLAMI v20.0 which comes with Theano 1.0.3?
Also, when you try to import theano, did you try to source activate theano_<pythonenv>, or switch kernel in notebook? Please note, theano is only installed in accordingly conda environment.
I have both Python 2.7 and 3.6 working on my machine. Numpy and Pandas both load, for either version of Python, in the terminal. However, when I try to access them from inside Jupyter notebook, I get the following error messages:
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-2-4ee716103900> in <module>()
----> 1 import numpy as np
ModuleNotFoundError: No module named 'numpy'
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-af55e7023913> in <module>()
----> 1 import pandas as pd
ModuleNotFoundError: No module named 'pandas'
Here is a screenshot of the problem as well:
If you look in the top right hand corner of the screenshot, you will notice where it says "Python3". I have seen video tutorials on Jupyter where clicking on that button generates a drop down list, allowing users to select alternate versions of Python. However, when I click on that button, nothing happens.
I noticed that a similar question was asked before here:
numpy & pandas 'ModuleNotFoundEror' in Jupyter notebook (Python 3)
However, very little information was provided and no resolution seems to have been found.
Another similar question provided a hint at an answer that was slightly more promising. It suggested running the following code both from terminal and from inside Jupyter, to make sure they match.
import sys; sys.executable
failed to import numpy as np when I worked with jupyter notebook
From terminal using Python 2.7.10>>
import sys; sys.executable
'/usr/bin/python'
From terminal using Python 3.6.1>>
import sys; sys.executable
'/usr/local/bin/python3'
From Jupyter>>
'/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6'
Have you checked this solution:
Failure to import numpy in Jupyter notebook ?
In your Jupyter screenshot, you're using a Python 3 kernel.
Make sure you have NumPy (and any others you might want to use) installed in your selected Python 3 environment.
I wanted to do LDA on some data and so followed this example:
http://scikit-learn.org/stable/auto_examples/decomposition/plot_pca_vs_lda.html#example-decomposition-plot-pca-vs-lda-py
however, on trying:
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
I got an import error. Huh, maybe this is a new function, I thought. So I updated scikit-learn via conda from 0.15.2 to 0.17. But now I can't even import sklearn:
import sklearn
RuntimeError: module compiled against API version a but this version of numpy is 9
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "//anaconda/lib/python2.7/site-packages/sklearn/__init__.py", line 57, in <module>
from .base import clone
File "//anaconda/lib/python2.7/site-packages/sklearn/base.py", line 9, in <module>
from scipy import sparse
File "//anaconda/lib/python2.7/site-packages/scipy/sparse/__init__.py", line 213, in <module>
from .csr import *
File "//anaconda/lib/python2.7/site-packages/scipy/sparse/csr.py", line 13, in <module>
from ._sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks, \
ImportError: numpy.core.multiarray failed to import
I tried updating numpy and scipy using both pip and conda to no avail. I then tried a complete clean re-install of anaconda by:
rm -rf ~/anaconda
and a subsequent download of the .pkg from http://docs.continuum.io/anaconda/install#anaconda-install
Still I get the same error. Here are my OS and package details:
Mac OSX 10.5.2
bash-3.2$ conda -V
conda 3.18.6
scipy==0.16.0
numpy==1.9.1
scikit-learn==0.17
The last of these via pip freeze since I can't import it. I'm going nuts here. Any help much appreciated.
Try:
conda install numpy=1.10.1
I've had that module compiled against API version a but this version of numpy is 9 error before, and this solved it for me.
This is what I see when I try to import mathplotlib
In [11]:
import numpy as np
import mathplotlib.pyplot as plt
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-11-d33586aa69ae> in <module>()
1 import numpy as np
----> 2 import mathplotlib as plt
ImportError: No module named mathplotlib
I am not sure it is relevant but in other forums people talk about their .bashrc files.
Lindas-iMac:~ iMacLinda$ cat .bashrc
export PATH="/Users/iMacLinda/anaconda/bin:$PATH"
Matplotlib is definitely installed
Lindas-iMac:~ iMacLinda$ conda list | grep matplo
matplotlib 1.4.3 np110py27_3
I have done the following updates
conda update ipython
conda update ipython-notebook
conda updata ipython-qtconsole
Does anyone have a solution to this?
sorry the problem was a typo. It should be matplotlib and not mathplotlib