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

安装Jupyter Hub后Conda失效,如何恢复至Python3.6环境?

Fixing Conda & Reverting to Python 3.6 After JupyterHub Installation

Alright, let's work through this step by step. The root problem is that installing JupyterHub from conda-forge pulled in Python 3.7, which overwrote your default Python path—making conda look for its modules in the wrong (3.7) environment instead of your working Python 3.6 setup. Here's how to get everything back on track:

1. Temporarily Restore Conda Access

First, we'll use your working Python 3.6 executable to run conda directly, bypassing the broken default path.

Find your Python 3.6 executable path (you mentioned it exists in your conda install directory—let's assume it's /data/pyconda3/python3.6/bin/python). Run this command to test if conda works with it:

/data/pyconda3/python3.6/bin/python /data/pyconda3/bin/conda --version

If this returns a valid conda version, we're good to move forward.

2. Activate Your Original Python 3.6 Environment

Use the same Python 3.6 path to activate your base (or preferred) 3.6 environment:

source /data/pyconda3/python3.6/bin/activate base

Once activated, you should be able to run conda directly without the full path now—test it with conda --version to confirm.

3. Reinstall Conda to Bind It to Python 3.6

To fix the broken module link, force-reinstall conda in your 3.6 environment:

conda install -n base conda --force-reinstall

This will refresh the conda modules and ensure they're tied to your Python 3.6 installation.

4. Set Python 3.6 as Your Default

Now we need to make sure your shell uses Python 3.6 by default:

  • Check your current default Python path with which python. If it points to Python 3.7, update your PATH environment variable to prioritize the 3.6 bin directory:
    export PATH="/data/pyconda3/python3.6/bin:$PATH"
    
  • To make this permanent, add the above line to your shell config file (e.g., ~/.bashrc or ~/.zshrc), then reload it:
    source ~/.bashrc
    
  • Fix any broken symlinks in your conda bin directory. If /data/pyconda3/bin/python links to Python 3.7, re-point it to 3.6:
    ln -sf /data/pyconda3/python3.6/bin/python /data/pyconda3/bin/python
    ln -sf /data/pyconda3/python3.6/bin/python3 /data/pyconda3/bin/python3
    

5. Uninstall Python 3.7

Since Python 3.7 was installed via conda, we can safely remove it using your restored conda setup:

  • First, list all conda environments to check if 3.7 is in a separate environment:
    conda env list
    
  • If it's in a dedicated environment, delete that environment with:
    conda env remove -n <environment-name>
    
  • If 3.7 was installed in your base environment (unlikely, but possible), remove it directly:
    conda remove python=3.7 --all
    

6. Verify Everything Works

Run these commands to confirm your setup is back to normal:

conda --version  # Should show your conda version without errors
python --version  # Should return Python 3.6.x
jupyter lab  # Should launch as it did before

If you still need JupyterHub, install it again but explicitly specify Python 3.6 to avoid pulling in 3.7:

conda install -c conda-forge jupyterhub python=3.6

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.13 07:57:46