You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Anaconda3环境Python3.6.4中Plotly导入异常:无法导入exceptions

Fixing Plotly Import Error in Anaconda Python 3.6.4 Environment

Hey there! Sorry to hear your Plotly import stopped working out of the blue. Let's walk through some steps to get it back up and running. First, let's recap your issue clearly:

You're using an Anaconda3-managed Python 3.6.4 environment, which worked fine with Plotly a few hours ago. Now running import plotly throws this error:

import plotly
Traceback (most recent call last):
  File "<ipython-input-1-6361d2547ebc>", line 1, in <module>
    import plotly
  File "C:\Users\janfe\Anaconda3\Lib\site-packages\plotly\plotly\plotly.py", line 30, in <module>
    from plotly import exceptions, files, session, tools, u...

This error usually pops up when there's a version mismatch between Plotly and your older Python 3.6.4 environment—newer Plotly versions (5.x and above) dropped support for Python 3.6. Here's how to fix it:

  • Step 1: Check your current Plotly version
    Open your Anaconda prompt, activate your Python 3.6.4 environment with conda activate <your-env-name>, then run either:

    conda list plotly
    

    or

    pip show plotly
    

    If the version is 5.x or higher, that's definitely the problem.

  • Step 2: Uninstall the incompatible Plotly version
    Depending on how you installed Plotly, run one of these commands:

    • For conda installations:
      conda remove plotly --yes
      
    • For pip installations:
      pip uninstall plotly --yes
      
  • Step 3: Install a Plotly version compatible with Python 3.6
    Plotly 4.x series still supports Python 3.6. Install the latest compatible version with:

    pip install plotly==4.14.3
    

    If you prefer conda, you can search for the compatible version with conda search plotly and install the highest 4.x version available (like conda install plotly=4.14.3).

  • Step 4: Verify the fix
    Open your IPython or Jupyter notebook again, run import plotly, and it should work without errors.

If this doesn't fix it, double-check that no other package updates messed up your environment—sometimes conflicting dependencies can break imports. But downgrading Plotly to a 4.x version is the most likely solution here.

内容的提问来源于stack exchange,提问作者Jan Felix

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 10:25:02