Here is the code that I used:
import math
import matplotlib.pyplot as plt
The error message was:
no module named 'matplotlib'
I have tried:
pip install matplotlib
python3 install mat plotlib
Tried updating Anaconda Navigator to the latest version.
Tried uninstalling and reinstalling Python 3.10.5
Tried using Visual Studio Code and individual Python files (I'll try Jupyter too).
conda update --all
python - version says that I have Python version 3.6.13
After all of that, I still get the same error that there is no module named matplotlib
The answer was that I had never actually attempted to access matplotlib outside of Jupyter Notebooks. I was only meant to access it inside of Jupyter. I created a virtual environment and that didn't work. I also did conda install matplotlib and that destroyed my Python install and I had to reinstall everything.
if I try to import tkinter in my project, pycharm underlines tkinter as being a missing library.
When I try to install the library, pycharm suggests to import the 'future' library instead of the tkinter library. I don't know why.
If I go to the project interpreter window, I cannot find the tkinter library after clicking on the install packages button.
On the pycharm terminal, if I try to pip install tkinter it returns:
Could not find a version that satisfies the requirement tkinter (from versions: )
No matching distribution found for tkinter
I get the same result when trying pip install python-tk, pip install python3-tk, and pip install tk.
Does anyone know why this is?
I imported the project from windows into Ubuntu Mint 19.1, I am using interpreter Python 3.7.2.
Please let me know if I can add any more useful info.
Install it via apt.
sudo apt-get update && sudo apt install python3-tk
Works for me.
I fixed the issue by uninstalling PyCharm, and reinstalling it from the command line. The previous version I had installed it through the Linux Mint 19.1 Software Manager, and the version installed behaved in very strange ways; for instance it showed a completely different file tree to the one in my machine when trying to setup interpreters.
Here is the command I used, as per JetBrains recommendation:
sudo snap install [pycharm-professional|pycharm-community] --classic
Note: I had to install snap first :)
tkinter is a built in library in python.
install this package :'future' using this command :
pip install future
now import 'tkinter' in your project :
import tkinter
I have installed this python package called shuttle using git bash. It works fine when I am using it in git bash. But when I am trying to import shuttle from Spyder or even Jupyter Notebook, its showing error -
ImportError: No module named 'shuttle'
Can you please explain why I am seeing this error and how can I fix it ?
Update: What I realise from searching in google, pip install/spyder/anaconda all have different environment. Because I installed 'shuttle' using pip, Spyder doesn't know about it. So now the problem is how do I install the package in Spyder environment or how do I make Spyder recognise that 'Shuttle' is already installed ?
This is how I solved it:
1. Install the package via pip. In your case shuttle
2. Locate the directory where shuttle is installed. You can do that by opening terminal
python
import shuttle
shuttle #displays location of shuttle
3. Now add shuttle to /path/to/anaconda/lib/
reference post: Anaconda: Permanently include external packages (like in PYTHONPATH)
I have just installed pandas_datareader using pip install pandas-datareader which ran successfully.
Now I am trying to use it for a tutorial and I am getting this error when I try to import.
import pandas_datareader as pdr
ModuleNotFoundError: No module named 'pandas_datareader'
This is the link to the tutorial.
https://www.datacamp.com/community/tutorials/finance-python-trading#gs.DgsO1BY
Any ideas?
Type into Terminal:
pip install pandas_datareader
That's it
Ok the following steps resolved the "No module named 'pandas_datareader" issue for me. To be clear, my situation was such that I had already installed pandas_datareader via pip install pandas_datareader but the "No module named 'pandas_datareader" error still kept popping up whenever I ran a .py code that imports pandas_datareader.
If you are in the same situation as I was (on Mac), this may help you.
Step 1: Uninstall the pandas_datareader package first:
via terminal, type pip uninstall pandas_datareader
it will prompt you asking for a y/n answer to proceed with the uninstallation
type 'y'
Step 2: Restart your IDE if you were using one
in my case, I was using MS VSC (Visual Studio Code)
Step 3:: re-install pandas_datareader package
again via terminal, type pip install pandas_datareader
your terminal may show you a bunch of "pre-installed" pandas_datareader package with message "Requirement already satisfied..."
ignore those.
Step 4: Run your python code again
the "No module named 'pandas_datareader" error should be gone this time round.
Hope this helps.
In your Anaconda Prompt, do this : pip install pandas_datareader
All the other methods didn't work for me.
In command prompt:
conda install -c delichon pandas_datareader
This is working fine on 22nd sept 2019
make sure to update pip.
For me, Import pandas_datareader worked from the command prompt while using python but did not work in jupyter.
From inside jupyter in a cell, I ran pip install pandas_datareader
I got a whole host of "Requirement already satisfied" messages
But at the very end, I was given this very important message. Successfully installed pandas-datareader-0.8.1 Note: you may need to restart the kernel to use updated packages In Jupyter notebook.
There is a kernel menu command sitting between cell and widgets. The restart command is in that drop-down menu option. In my case, this restarting of the kernel was the solution to my " No module named 'pandas_datareader' " all along.
Had the same issue. This resolved it for me:
after activating the env, run:
pip install pip --upgrade
pip install pandas-datareader
pip install jupyter (as i was using a jupyter notebook)
However, if you are running anaconda, use:
conda install -c anaconda pandas-datareader
I had the same problem. I tried pip install pandas_datareader in my Anaconda Prompt and the problem was solved. For some reason, it didn't work in command prompt.
Got this error even though I had pandas_datareader installed. Running on Windows. py -3 -m pip install pandas_datareader in the command prompt didn't work. Same in anaconda prompt didn't work. pip uninstall pandas_datareader followed by pip install pandas_datareader and a reboot finally fixed my problem.
TLDR if running on a Windows machine, uninstall pandas_datareader if you have it (pip uninstall pandas_datareader) and then reinstall with 'pip install pandas_datareader'.
You may consider upgrading your pandas with:
pip3 install --upgrade pandas
I had the same issue installing through my terminal. Since I'm using Anaconda Navigator, I tried the CMD.exe Prompt and inputted "conda install -c conda-forge pandas-datareader".
Jupyter notebook now works like a charm.
I was having this same issue in Jupyter Notebook, where it wasnt recognizing pandas_datareader, even though it said that it was installed successfully in anaconda prompt.
I figured out that my jupyter notebook wasnt opening up in my environment. I activated my environment in Anaconda Prompt and then did conda install nb_conda_kernels. When I opened up Jupyter notebook and checked my env, I was in the correct one, and it recognized my pandas_datareader import. You can check your environment using:
import sys
print(sys.prefix)
This is a SO thread that helped me: Conda environments not showing up in Jupyter Notebook
I was having the same issue. I tried pip install pandas-datareader, pip install pandas_datareader, python3 -m pip install pandas_datareader on termianl, I see message saying I have successfully installed the package but none of them worked. I use Pycharm as my IDE and when I checked File-->Setting-->Progect:File-->Python interpreter, pandas-datareader is not in the package list. I use anaconda as my python Interpreter. So, just added the package into the interpreter and finally worked.
if you facing this error ,you have have to install pandas_datareader.
you can install this package by Jupyter notebook also.
"pip install pandas_datareader"
enter image description here
Go to C:\Users\[UserName]\AppData\Roaming\jupyter\kernels\python3 and open up kernel.json. Check the first argument is pointing to a Python 3 environment/the environment you installed pandas_datareader to.
If you are facing this issue in Jupyter Notebook, just restart the kernel within the IDE.
-Make sure u have installed pandas_datareader with "pip install pandas_datareader"
-Click on the tab named 'kernel'
-Click Restart
Your Problem will be resolved
Trying to import python module fake_useragent
Command prompt stating that it has already been installed.
Anybody knows how come I still cannot import the fake_useragent module in python even though I have already installed it?
Thank you very much, I have solved the problem. I have tried to uninstall and reinstall the module but it still did not work. I tried to use Jupyter Notebook as well as Pycharm to import the module but I could not. Eventually, I tried to import the module using IDLE, which is the default IDE which comes with downloading and installing Python from python.org and I was successful. Therefore, I suspected that I had accidentally installed two versions of Python on my computer. The problem is that I have already installed Python 3 inside my computer. However, on top of that, I have also installed the Anaconda package, which also installs its own version of Python 3. However, when I use pip to install the fake-useragent module, I am installing it for the original python version. Therefore, when I use Jupyter notebook which is part of the Anaconda package, I could not input the module. I could not import it for Pycharm as well since I used the Anaconda interpreter as Pycharm's default interpreter. After I have uninstalled Anaconda and changed the default interpreter for Pycharm under settings back to the original version of Python which I have installed, I'm able to import the fake-useragent in python.