Python 3.6.4环境下如何分步安装Dash及dash_core_components?
Hey there! I get it—installing new packages can feel tricky when you're starting out, especially with older Python versions like 3.6.4. Let's fix those installation errors and get Dash up and running properly.
First, Prep Your Conda Environment
- Open Anaconda Prompt and activate your target environment (use the base environment if you haven't created a custom one):
conda activate base - Conda's default channels don't host Dash, so we need to add the trusted
conda-forgechannel (it’s the go-to for most third-party Python packages):
This ensures Conda prioritizes packages from conda-forge, avoiding messy version conflicts.conda config --add channels conda-forge conda config --set channel_priority strict
Install Dash & Core Components (Conda Method)
Since you’re using Anaconda, this is the most reliable approach. Run this command to install Dash and all required components in one shot—we’re specifying older versions because Python 3.6 isn’t supported by the latest Dash releases (2.0+ requires Python 3.7+):
conda install dash==1.21.0 dash-core-components==1.17.1 dash-html-components==1.1.4 dash-table==4.12.0
If Conda Fails: Use Conda-Environment Pip
If the conda install still throws errors, make sure you’re using the pip tied to your Anaconda environment (not your system’s pip, which might install packages outside your environment). Run:
conda run pip install dash==1.21.0 dash-core-components==1.17.1 dash-html-components==1.1.4 dash-table==4.12.0
Fix Spyder’s Pop-Up Prompt
After installing Dash, close and restart Spyder completely—it needs to reload your environment’s package list to recognize the new installs. If you still get a partial pop-up, it’s likely a version mismatch between Spyder and Python 3.6.4. Install a compatible Spyder version with:
conda install spyder=3.3.6
This version is built to work seamlessly with Python 3.6.x.
Once you’ve finished these steps, test your setup with a simple Dash hello-world script—you should be all set to build your first dashboard!
内容的提问来源于stack exchange,提问作者mcb

