简体   繁体   中英

Cannot import pandas through PyCharm:ModuleNotFoundError: No module named 'pandas'

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

没有其他解决方案,直接通过解释器安装它。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM