Tensor-flow installation issue - python

ipynb code:
"import matplotlib as mpl\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import pandas as pd\n",
"import tensorflow as tf\n",
"\n",
"from mpl_toolkits.mplot3d import Axes3D # needed for project='3d'\n",
"import helpers_02\n",
"\n",
"%matplotlib inline"
Output:
ModuleNotFoundError Traceback (most recent call last)
in ()
3 import numpy as np
4 import pandas as pd
----> 5 import tensorflow as tf
6
7 from mpl_toolkits.mplot3d import Axes3D # needed for project='3d'
ModuleNotFoundError: No module named 'tensorflow'
Why does it say?
ModuleNotFoundError: No module named 'tensorflow'
On trying to install using
C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.4.0-py2-none-any.whl
tensorflow-1.4.0-py2-none-any.whl is not a supported wheel on this platform.

This last install issue just happened to me. It seems as though the 1.4.0 version is not current. If you copy the URL from https://pypi.python.org/pypi/tensorflow you can find a whl file for your python and os version. print(tf.VERSION) now gives 1.4.1

Related

ModuleNotFoundError while importing 'emoji' in Jupyter

I get an error when I import the emoji into my Jupyter notebook.
This is the error I'm getting.
ModuleNotFoundError Traceback (most recent call last)
/var/folders/8v/gry0pxmn7tq64rhkjv504zr00000gn/T/ipykernel_12578/2329533640.py in <module>
2 import pandas as pd
3 import numpy as np
----> 4 import emoji
5 from collections import Counter
6 import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'emoji'
I am using MacOs. How do I solve this?
Did you install the library?
For the installation process via pip:
pip install emoji --upgrade
or via git:
git clone https://github.com/carpedm20/emoji.git
cd emoji
python setup.py install
That being done, you can import emoji into your code.
For further information you can read the installation process on the documentation here.

Error when importing matplotlib in Python

I am new to python and am just getting started. I have a Jupyter Notebook from my university and have to plot something using matplotlib. All I find on the web is this:
import numpy as np
import matplotlib.pyplot as plt
but when I try that, it tells me
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-12-e0e1492b7973> in <module>
1 import numpy as np
----> 2 import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'
Any help and further tips are very welcome.
matplotlib has to be installed
pip3 install matplotlib
since you have the jupyter tag, installing it with the Anaconda Prompt is an option
conda install matplotlib

ModuleNotFoundError: No module named 'mglearn'

This is a commmon question, but nothing worked for me so far.
I have seen this answer too Python 3 on Mac : ModuleNotFoundError: No module named 'mglearn'
!pip install mglearn
!pip install sklearn
!pip install -U scikit-learn
import mglearn
import sklearn
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-fe22f30497b9> in <module>
----> 1 import mglearn
2 import sklearn
ModuleNotFoundError: No module named 'mglearn'
I checked other questions but failed to solve it. I have macOS Catalina 10.15.7
import sys
!{sys.executable} -m pip install mglearn
Try using this. This assures that you are using the pip version associated with the environment.

ModuleNotFoundError: No module named 'syft' (PySyft)

i install Pysyft using this :
conda create -n pysyft python=3
conda activate pysyft
activate pysyft" instead "
pip install syft
and yet when i try to import the library
from syft.frameworks.torch.differential_privacy import pate
it's show me this error :
ModuleNotFoundError Traceback (most recent call last)
in
1 import numpy as np
----> 2 from syft.frameworks.torch.differential_privacy import pate
ModuleNotFoundError: No module named 'syft'
According to the repository import changed to:
from syft.frameworks.torch.dp import pate

"No module named plotly"

My problem is very simple. I have installed it with sudo pip3 install plotly but I can't import it. I've already tried to reinstall it without effects.
ImportError Traceback (most recent call last)
<ipython-input-1-9d1f271208ac> in <module>()
----> 1 import plotly.plotly as py
2 import plotly.graph_objs as go
3 import pandas as pd
4 from pandas import Series,DataFrame
5 import numpy as np
ImportError: No module named 'plotly'
If this error occurs open Terminal and if you using different source like ZSH or something else change it to bash by running
bash
in terminal and then run
conda install -c https://conda.anaconda.org/plotly plotly
and the problem resolves.

Categories