[英]plotly - AttributeError: 'module' object has no attribute 'tools'
當我嘗試將圖樣用於Python 2.7時,出現AttributeError。
In [1]: import plotly
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-1-c27a4132ad2e> in <module>()
----> 1 import plotly
c:\projects\flask\plotly.pyc in <module>()
AttributeError: 'module' object has no attribute 'tools'
所以我嘗試了這個:
pip install tools
它給了我一個錯誤: Failed building wheel for lxml
。 所以我剛安裝了一個.whl文件
pip install lxml-3.6.0-cp27-none-win32.whl
之后,我能夠安裝工具模塊。 但是,AttributeError仍然存在,並且不會讓我隨意使用。
另外,我嘗試使用設置虛擬環境,然后密謀使用-得到相同的錯誤。
修復它...我要做的就是刪除主目錄中的plotly.pyc文件。 不知道它是做什么用的以及它是如何到達那里的,但是它似乎不合適,所以我刪除了它並起作用了!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.