我在Mac上使用VS代码进行Python作业。我安装了pandas,numpy和其他一些库,但仅导入pandas会出现以下错误:
File "/Users/Li/Documents/Resources/lynda/recsys/RecSys-Materials/test.py", line 1, in <module>
import pandas as pd
ImportError: No module named pandas
我仔细检查了熊猫的安装:
pip install pandas
Requirement already satisfied: pandas in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (0.25.1)
Requirement already satisfied: python-dateutil>=2.6.1 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from pandas) (2.7.4)
Requirement already satisfied: numpy>=1.13.3 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from pandas) (1.17.1)
Requirement already satisfied: pytz>=2017.2 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from pandas) (2018.9)
Requirement already satisfied: six>=1.5 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from python-dateutil>=2.6.1->pandas) (1.11.0)
和numpy:
pip install numpy
Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (1.17.1)
VS Code setting: python select interpreter: current: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
我想知道我做错了哪一部分。任何帮助将不胜感激!
答案 0 :(得分:0)
错误可能是由于无法从路径中检测到库引起的。