我在Mac OS上安装了anaconda。但是,当我尝试导入熊猫库时,由于找不到熊猫模块而抛出错误。
因此,当我再次尝试安装熊猫时。上面说熊猫已经安装在机器上了
C27:python-programming jyoti.aditya$ pip install pandas
Requirement already satisfied: pandas in
/Users/aditya/anaconda3/lib/python3.7/site-packages (0.23.4)
Requirement already satisfied: python-dateutil>=2.5.0 in
/Users/aditya/anaconda3/lib/python3.7/site-packages (from pandas)
(2.7.3)
Requirement already satisfied: pytz>=2011k in
/Users/aditya/anaconda3/lib/python3.7/site-packages (from pandas)
(2018.5)
Requirement already satisfied: numpy>=1.9.0 in
/Users/aditya/anaconda3/lib/python3.7/site-packages (from pandas)
(1.15.1)
Requirement already satisfied: six>=1.5 in
/Users/aditya/anaconda3/lib/python3.7/site-packages (from python-
dateutil>=2.5.0->pandas) (1.11.0)
但是当我尝试在我的python代码中导入Panda库时。抛出错误
C27:python-programming aditya$ python
Python 3.7.0 (default, Jun 28 2018, 07:39:16)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import panda as pd
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'panda'
答案 0 :(得分:3)
答案 1 :(得分:2)
您已经通过pandas
安装了pip
,但是在尝试导入时却错过了pandas
结尾处的s。
import pandas as pd
将起作用。