ModuleNotFoundError: No module named 'matplotlib.colorbar' - matplotlib

I tried upgrading my matplotlib to the 3.4.2 version. I first did
pip install matplotlib==3.4.2
It successfully installed. But when I try and import the package in Jupyter, it gives me an error
ModuleNotFoundError: No module named 'matplotlib.colorbar'
I have tried to uninstall matplotlib and then install again using
pip3 install matplotlib
But I get the same error. Also in my Anaconda Navigator window I see the older version 3.3.4 still installed

Related

Can't import pytorch_lightning on Google colab

I'm using !pip install git+https://github.com/PyTorchLightning/pytorch-lightning
but when I'm importing pytorch_lightning I get the following error:
ImportError: cannot import name '_RequirementAvailable' from 'pytorch_lightning.utilities.imports' (/usr/local/lib/python3.7/dist-packages/pytorch_lightning/utilities/imports.py)
It all worked fine a week ago...
When you install Lightning as
pip install git+https://github.com/PyTorchLightning/pytorch-lightning
you get the latest version in development. It is not an official release. I recommend installing
pip install pytorch-lightning
to get the latest stable release. I suspect this will solve your import error.

ModuleNotFoundError: No module named 'flask_sqlalchemy

I am getting this error when i try to run:
flask db upgrade
from flask_sqlalchemy import SQLAlchemy
ModuleNotFoundError: No module named 'flask_sqlalchemy'
I verified that flask-sqlalchemy is already installed:
Requirement already satisfied: flask-sqlalchemy in ./venv/lib/python3.6/site-packages (2.4.4)
Are you using the correct version of Python? By installing flask_sqlalchemy and using Python3, make sure you install the module by typing pip3 install flask-sqlalchemy, so the module gets installed in Python3 and not another version. If you want to use Python2, make sure using the normal command pip install flask-sqlalchemy.

Cant run modules

everytime after downloading a module a cant run it, what im doing wrong?
I've installed it using:
pip install pyperclip
It has been installed succesfully:
C:\WINDOWS\system32>pip list
Package Version
--------------- ---------
certifi 2020.6.20
clipboard 0.0.4
colorama 0.4.3
cycler 0.10.0
handcalcs 0.8.1
kiwisolver 1.2.0
matplotlib 3.3.1
numpy 1.19.1
Pillow 7.2.0
pip 20.2.3
pyparsing 2.4.7
pyperclip 1.7.0
python-dateutil 2.8.1
qrcode 6.1
six 1.15.0
sqrc 0.0.3
But when running the code, this is what a get:
import pyperclip
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import pyperclip
ModuleNotFoundError: No module named 'pyperclip'
Any help on this?
That can be specific for a programming platform you are using. Some platforms like PyCharm enable to install modules directly from themselves so using modules becomes much easier.

How to install numpy on vscode on mac?

It's saying:
"ModuleNotFoundError: No module named 'numpy'"
and then when I do "pip install numpy" it says:
Requirement already satisfied: numpy in ./Library/Python/2.7/lib/python/site-packages (1.16.6)"
Probably you are using python 3.X while pip is configured for python 2.X.
Try running pip3 install numpy
Basically you are installing a package for python 2, while running the script with python 3.

Error installing matplotlib in a virtual environment python 2.7

I have been trying to install matplotlib in a virtual environment using pip.
after working on the virtual environment I tried:
$pip install matplotlib
but I get the error:
unable to execute 'c++' : No such file or directory
error : command 'c++' failed with exit status 1
------------------------------------------
Cleaning up
I am on ubuntu 14.04 and matplotlib works well for me when not using virtualenv, but I would like to have it in a virtualenv for separate projects that I have.
any suggestions?
Solved this problem by just upgrading pip, it seems there was an issue of version 1.5.4 which was installed when creating virtualenv.
$ pip install --upgrade pip
then installed matplotlib using pip
$pip install matplotlib