无法导入熊猫

时间:2015-08-10 02:07:19

标签: python numpy pandas anaconda

也许我之前并不清楚所以我正在重新格式化整个问题。我的路径变量很可能出现了一些错误,我不知道如何修复......

我有一个名为test.py的脚本:

import pandas as pd
df = pd.csv_read("nbaData.csv")

运行此脚本时出现此错误:

C:\Users\joeblow\Desktop\repos\BitBucket\basketball>python test.py
Traceback (most recent call last):
  File "test.py", line 1, in <module>
    import pandas as pd
  File "C:\Python27\lib\site-packages\pandas\__init__.py", line 13, in <module>
    "extensions first.".format(module))
ImportError: C extension: No module named numpy not built. If you want to import
 pandas from the source directory, you may need to run 'python setup.py build_ex
t --inplace' to build the C extensions first.

输入conda install pandas

C:\Users\joeblow\Desktop\repos\BitBucket\basketball>conda install pandas
Fetching package metadata: C:\Users\joeblow\Anaconda\lib\site-packages\requests\p
ackages\urllib3\util\ssl_.py:90: InsecurePlatformWarning: A true SSLContext obje
ct is not available. This prevents urllib3 from configuring SSL appropriately an
d may cause certain SSL connections to fail. For more information, see https://u
rllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
....
Solving package specifications: .
# All requested packages already installed.
# packages in environment at C:\Users\joeblow\Anaconda:
#
pandas                    0.16.2               np19py27_0

这个问题可以由主持人删除。我的解决方案涉及在我的计算机上卸载并重新安装python

1 个答案:

答案 0 :(得分:0)

似乎Conda没有你所有的软件包,我建议使用Anaconda并遵循这些说明它包含所有软件包,包括Pandas无需在Windows上安装任何其他软件包。

operator[](pos)