in my code, there are
import seaborn
and they give me
no module named seaborn
when I use
pip install seaborn
it gives me Requirement already satisfied but I still couldnot import seaborn so I use pip3 install seaborn,it reports so many errors as follow:
Using cached https://files.pythonhosted.org/packages/2f/79/f236ab1cfde94bac03d7b58f3f2ab0b1cc71d6a8bda3b25ce370a9fe4ab1/pandas-1.0.3.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-c8lrjdqb/pandas/setup.py", line 42
f"numpy >= {min_numpy_ver}",
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-c8lrjdqb/pandas/
I don't know how to solve this, and I have upgraded my setuptools like:pip install --upgrade setuptools and also pip3 install --upgrade setuptools
and also I have tried conda install seaborn it looks like work well but when I run my code, it still told me no module name seaborn
so how could I install seaborn on my ubuntu?
I have checked my python version by python --version it is python3.8.
Same problem also happened with install pandas*.
Both python2 and python3 come shipped along with Ubuntu, so installing packages with just pip might be your issue as that is the default package manager for python 2.
Try the following in your terminal:
$ python3 -m pip list | grep seaborn
If you dont get an output then this shows you that seaborn hasn't been installed via pip linked to your python3 interpreter.
It is good practice to install packages for your interpreter specifically as follows:
$ python3 -m pip install <insert name of package here>
Finally to check that the package has installed correctly launch the python3 interpreter within your terminal and try and import the package e.g.
$ python3
>>> import seaborn as sns
Most of the packages for your python distribution should be in the following directory:
$ cd /usr/local/lib/python3.8/dist-packages
The above are just a few pointers to get you started, hope that helped!
Related
I am unable to successfully install packages from pip commands in my jupyter notebook. Each time I use pip commands, it shows:
Example: pip install matplotlib
Requirement already satisfied: .....
WARNING: Ignoring invalid distribution -umpy(appdata\local\continuum\anaconda3\lib\site-packages)
WARNING: Ignoring invalid distribution -umpy(appdata\local\continuum\anaconda3\lib\site-packages)
WARNING: Ignoring invalid distribution -umpy(appdata\local\continuum\anaconda3\lib\site-packages)
I tried different commands like sudo, !, python -m pip. But nothing works. I am constantly getting
import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'
pip version: pip 21.2.4 from C:\Users\AppData\Local\Continuum\anaconda3\lib\site-packages\pip (python 3.7)
Use the direct pip of your python using the command:
my/path/to/python -m pip install matplotlib
Often pip is linked with python 2.7 if you have it.
Then pip3 is linked with your first python3 installation.
You have to use directly python -m pip to be sure you are installing modules in the right python directory.
I'm using Python 3.8(64-bit)
Basically, I tried every possible solution on the internet like update the python version and tensorflow version etc.
But when I try to do this:
import tensorflow_quantum as tfq
terminal always say:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorflow_quantum'
Does anyone have any idea on this issue? Cheers
Please run the following:
pip3 install --upgrade pip
pip3 install tensorflow==2.3.1
pip3 install -U tensorflow-quantum
I have faced quite a similar problem and I followed this link for some help
in short I created a virtual environment with
python version == 3.6.2
conda create -n your_new_env_name python=3.6.2 anaconda
and then activated this environment as follows before you continue
conda activate your_new_env_name
then installed tensorflow
pip install tensorflow==2.1.0
pip install tensorflow-gpu=2.0.0
pip install tensorflow-quantum
you may face 2 errors which you might need to be solved
the first is this
When importing tensorflow, I get the following error:
No module named 'numpy.core._multiarray_umath'
all you have to do is this
pip install numpy --upgrade
or if needed
pip install numpy --upgrade --user
you may also get an error when import tensorflow-quantum that's related to google.api_core and what solved the problem for me was to do the following
pip install google.api_core==1.16.0
you may also need to the following
pip install cython
I hope it works!
I'm trying to install this framework from Github called torch2trt (found here:https://github.com/NVIDIA-AI-IOT/torch2trt).
I ran the following code in a Python terminal to install it:
git clone https://github.com/NVIDIA-AI-IOT/torch2trt
cd torch2trt
python setup.py install
but ended up with the following error message:
Traceback (most recent call last):
File "setup.py", line 2, in <module>
import torch
ImportError: No module named torch
I have already installed pytorch using pip install torch torchvision
Does anyone know how to resolve this?
Try running everything in python3:
python3 -m pip install torch torchvision
followed by :
python3 setup.py install
In Linux,
which python
which pip
In Windows power shell
where python
where pip
Check if both pip and python are from same parent directory.
python defaults to python2
So you should change python setup.py install to python3 setup.py install
Otherwise you can check the PyTorch page and try another version. https://pytorch.org/get-started/locally/
I would try this one first.
pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
You haven't installed Torch. Install it with pip via: https://pytorch.org/get-started/locally/
I keep getting an error in Git Bash as I run my python code:
$ python Humiditypyth.py
Traceback (most recent call last):
File "Humiditypyth.py", line 1, in <module>
import pandas as pd
ImportError: No module named pandas
I have Anaconda installed and I checked in "python list" that pandas is installed. Can you please help?
Try
python3.6 Humiditypyth.py. [try using sudo if it doesn’t help]
pip3 freeze - check if you can see pandas in there. If not do
pip3 install pandas
Let's do a checklist
Do you have anaconda installed in the same python version that you are using? e.g. if python is calling python2.7 and python3 does python 3.6 you have to install anaconda in the right folder with either "sudo pip install anaconda" or "sudo pip3 install anaconda"
after that I think you still have to install pandas "pip install pandas" or "pip3 install pandas"
I might be wrong though I never used that library.
I installed matplotlib using (pip install --user matplotlib) and the installation was successful. when I try to import it using (import matplotlib) in python shell I get this error:
Traceback (most recent call last):
File "", line 1, in
import matplotlib
ImportError: No module named matplotlib
I couldn't find another question similar to mine because I'm not using anaconda.
Try pip uninstall matplotlib then python -mpip install matplotlib see if it helps. Otherwise, i'd recommend using a virtual environment which you can install using sudo easy_install virtualenv or pip install virtualenv This way you could just install and use matplotlib by following these steps:
Create a new virtual environment : user#yourmac$ virtualenv .env (.env can be any name or directory)
Activate it by doing : user#yourmac$ source .env/bin/activate
Then once it's activated just do a pip install matplotlib and use it to your satisfaction.
Hopefully this should solve your problem.