ImportError: No module named pandas [pycharm] python 3.7 - pandas

I write the code like this:
import pandas as pd
import quandl
df = quandl.get('WIKI/GOOGL')
print(df.head())
and I have the error as below
C:\Users\Administrator\PycharmProjects\untitled1\venv\Scripts\python.exe C:/Users/Administrator/PycharmProjects/untitled1/regression.py
Traceback (most recent call last):
File "C:/Users/Administrator/PycharmProjects/untitled1/regression.py", line 1, in
import pandas as pd
ModuleNotFoundError: No module named 'pandas'
Process finished with exit code 1
I tried to test many recommendations from the internet, but I cannot fix this error. Please help me! Thank you so much.

If you are using bare python install pandas using pip "pip install pandas", If you are using anaconda, check your python interpreter from pycharm. Go to File->Settings->Project Settings->Project Interpreter->Python Interpreters Ensure to select correct version of python.exe e.g C:\Program Files\Python37\python.exe for bare python (For this you need to install pandas ) For anaconda you'll see C:\Users\xxx\AppData\Local\Continuum\anaconda3\python.exe. select the correct interpreter and you are good to go

Related

Why is import pandas giving me an error message?

Hi I have installed pandas into my virtual environment in VS Code. I can import other modules that came when pip installed pandas(numpy) but it gives me:
Traceback (most recent call last):
File "/Users/aidan/VS_Studios/Graphing Data/main.py", line 2, in <module>
import pandas as pd
ImportError: No module named pandas
When I try and import pandas into my main.py file. This is my virtual environment:
I have wheels installed and have python running on 3.11.8 and everything is local.
Please help thank you!
I have tried unistalling pandas and checking to see if both my interpreter pip and python are all on the same version, they are. IDK what else I need to do.

import yfinance issue - numpy dependency problem? Need to uninstall then reinstall numpy every time. Code works from CLI, but not in PyCharm

I am trying to use the yfinance module. I have a venv set up. If I run my code from the command line it works. If I run it inside PyCharm it throws this import error. Doing pip uninstall -y numpy and then pip install numpy fixes the problem, but I have to do this every day. I'm very confused on what is the issue. Anyone have any tips?
It is failing at literally the first line of code which is the import yfinance line. Here is the traceback:
Traceback (most recent call last):
File "/Users/MikeGuglielmo/Desktop/python_code.py/python_distilled/practice.py/main.py", line 1, in
import yfinance as yf
File "/Users/MikeGuglielmo/Desktop/python_code.py/options_project/venv/lib/python3.9/site-packages/yfinance/init.py", line 23, in
from .ticker import Ticker
File "/Users/MikeGuglielmo/Desktop/python_code.py/options_project/venv/lib/python3.9/site-packages/yfinance/ticker.py", line 27, in
import pandas as _pd
File "/Users/MikeGuglielmo/Desktop/python_code.py/options_project/venv/lib/python3.9/site-packages/pandas/init.py", line 16, in
raise ImportError(
ImportError: Unable to import required dependencies:
numpy:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
The Python version is: Python3.9 from "/Users/MikeGuglielmo/Desktop/python_code.py/options_project/venv/bin/python"
The NumPy version is: "1.23.3"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: No module named 'numpy.core._multiarray_umath'

ImportError Pandas in Jupiter notebook - Not looking at venv packages

I installed pandas via pip in my virtualenv venv.
When I run import pandas as pd, I get the following error:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-588656c123e4> in <module>
3 import tarfile #2
4 from six.moves import urllib #3
----> 5 import pandas as pd #4
ModuleNotFoundError: No module named 'pandas'
I am running Jupiter notebook in the virtual environment. To make sure it installed properly, I opened the python in the virtualenv and ran the import, and it worked fine, what could be the issue? Could it be that though I ran Jupiter Notebook in my venv its not looking at the packages in the virtual environment?
Edit 1: I installed pandas on my machine, not in the virtual machine, and that resolved my issue. However, I want the notebook to look at the packages in my virtual environment, how do I do that?
Try running this in a Jupyter cell
!pip install pandas

ImportError: No module named 'numpy.testing.nosetester'

I am facing an issue when I run 'from sklearn.model_selection import train_test_split' in jupyter notebook. I tried to upgrade/reinstall numpy, scipy and pandas but still cannot fix the problem. Please help. Thanks in advance.
Upgrade numpy/scipy.
( Possible duplicate:
ModuleNotFoundError: No module named 'numpy.testing.nosetester' )
Using Python3:
pip3 install numpy==1.16.4

No module named 'pandastable'

I'm trying to change table wrote by me on tkinter with the pandastable one in order to do the handling of data directly from a pandas.DataFrame.
But despite I have already installed Anaconda3 with matlplotlib, numpy, pandas ect. modules when i would like to import pandastable I have trouble.
This is the problem:
import pandastable
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
import pandastable
ImportError: No module named 'pandastable'
pip install pandastable
Requires python>=3.3 or 2.7 and numpy, matplotlib and pandas.
See: pandastable on github
edit: You may have multiple Python environments installed on your machine. Anaconda uses conda install to keep things in check but pandastable doesn't seem to be available through Anaconda packages. Make sure you are installing to the same Python environment that your script uses. You might also try:
pip3 install pandastable