Python&aconda系列:【python环境搭建】conda 安装过程中无法激活 python 虚拟环境问题




1.概要

最近重新学习python 需要搭建conda 环境 遇到一个懵逼的问题

C:\Users\67656>conda activate Date
 
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
If using 'conda activate' from a batch script, change your
invocation to 'CALL conda.bat activate'.
 
To initialize your shell, run

CSDN 上搜了一堆,照着试了试问题还是没有解决。没办法只能自己想办法,思考了一下这种问题的原因,应该是windows 环境变量配置有问题

这是别人的例子怎么解决 问题,没有找到根本原因

C:\Users\67656>conda init cmd.exe
no change     D:\InstallApp\Anaconda3\Scripts\conda.exe
no change     D:\InstallApp\Anaconda3\Scripts\conda-env.exe
no change     D:\InstallApp\Anaconda3\Scripts\conda-script.py
no change     D:\InstallApp\Anaconda3\Scripts\conda-env-script.py
no change     D:\InstallApp\Anaconda3\condabin\conda.bat
no change     D:\InstallApp\Anaconda3\Library\bin\conda.bat
no change     D:\InstallApp\Anaconda3\condabin\_conda_activate.bat
no change     D:\InstallApp\Anaconda3\condabin\rename_tmp.bat
no change     D:\InstallApp\Anaconda3\condabin\conda_auto_activate.bat
no change     D:\InstallApp\Anaconda3\condabin\conda_hook.bat
no change     D:\InstallApp\Anaconda3\Scripts\activate.bat
no change     D:\InstallApp\Anaconda3\condabin\activate.bat
no change     D:\InstallApp\Anaconda3\condabin\deactivate.bat
no change     D:\InstallApp\Anaconda3\Scripts\activate
no change     D:\InstallApp\Anaconda3\Scripts\deactivate
no change     D:\InstallApp\Anaconda3\etc\profile.d\conda.sh
no change     D:\InstallApp\Anaconda3\etc\fish\conf.d\conda.fish
no change     D:\InstallApp\Anaconda3\shell\condabin\Conda.psm1
no change     D:\InstallApp\Anaconda3\shell\condabin\conda-hook.ps1
no change     D:\InstallApp\Anaconda3\Lib\site-packages\xontrib\conda.xsh
no change     D:\InstallApp\Anaconda3\etc\profile.d\conda.csh
modified      HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun
 
==> For changes to take effect, close and re-open your current shell. <==
 
 
C:\Users\67656>conda activate Base
 
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
If using 'conda activate' from a batch script, change your
invocation to 'CALL conda.bat activate'.
 
To initialize your shell, run
 
    $ conda init <SHELL_NAME>
 
Currently supported shells are:
  - bash
  - cmd.exe
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell
 
See 'conda init --help' for more information and options.
 
IMPORTANT: You may need to close and restart your shell after running 'conda init'.
 
 
 
C:\Users\67656>

实际上问题没有解决。

2.解决办法

因为是在用户环境中所以需要设置conda 的环境变量

在这里插入图片描述
用户环境需要添加环境变量
在这里插入图片描述
当然系统环境下,最好尽量也去配置

在这里插入图片描述
两个都加是双保险

以下自己的运行结果

在这里插入图片描述
运行jupyter notebook

在这里插入图片描述

jupyter notebook 运行成功

在这里插入图片描述







粽子的蛋蛋

【python环境搭建】conda 安装过程中无法激活 python 虚拟环境问题

  • 6
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

坦笑&&life

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值