簡體   English   中英

肯定已安裝,但未導入Python-2.7模塊

[英]A module of Python-2.7 not getting imported when it is definitely installed

我的熊貓包裝沒有被進口。 當我嘗試使用以下命令檢查我是否有大熊貓時

python -c "import pandas"

它顯示了一些奇怪的錯誤,例如

<module 'numpy' from 'numpy.pyc'>
'module' object has no attribute 'dtype'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/pandas/__init__.py", line 6, in   <module>
from . import hashtable, tslib, lib
File "numpy.pxd", line 157, in init pandas.hashtable    (pandas/hashtable.c:21706)
AttributeError: 'module' object has no attribute 'dtype'

您將導入一個名為numpy.py本地文件,而不是全局安裝的NumPy項目:

<module 'numpy' from 'numpy.pyc'>

刪除或重命名該文件,然后刪除該文件旁邊的關聯numpy.pyc文件。 你的本地文件沒有名稱dtype ,只有numpy 軟件包安裝在您的site-packages呢,但是當你的文件第一次每一次發現它無法加載。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM