0
votes

Appreciate that this question has been asked a number of times before. I've spent a few hours working through the suggestions in previous answers but am still stuck.

I have installed Anaconda 1.9.7 and PyCharm 2019.2 on my Mac running Mojave version 10.14.5.

Through Conda 4.7.10 I have Python 3.7.3 and have pandas 0.25.0 installed.

When I create a new project in PyCharm and try to run the line:

import pandas as pd

I get the error message:

ModuleNotFoundError: No module named 'pandas'

Attempted solutions:

  1. Have uninstalled and reinstalled PyCharm
  2. Checked that all relevant programmes are installed and up to date
  3. Checked the project interpreter is correct:

Conda Environment Location: /Users/Barton/PyCharm/Get Pandas to Work Python Version: 3.7 Conda executable: /Users/Barton/anaconda3/bin/conda

Any help much appreciated.

Thanks David

2
Did you install pandas via this: conda install -c anaconda pandas ? - PyStraw45
Pandas cam pre-installed with Anaconda Navigator. Do I need to install through conda as well? Thanks D - David B
Give it a try, it's difficult to tell what your environment looks like/how it was installed in the first place - PyStraw45
Ran: conda install -c anaconda pandas. It did update and supersede a few packages. Have recreated the conda environment but unfortunately still not working! Still getting the original error message - David B
Does the pandas package show within the pycharm project interpreter ? - PyStraw45

2 Answers

0
votes

When working with Python, the best answer is to always use a virtual environment. You might fix this specific issue but later down the line, another import related issue may show up.

1
votes

Install it directly through the interpreter as no other solutions worked.