V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
huc2
V2EX  ›  Python

vscode 打开的终端为什么会有 2 个 conda 环境

  •  
  •   huc2 · 67 天前 · 1232 次点击
    这是一个创建于 67 天前的主题,其中的信息可能已经有所发展或是发生改变。

    电脑自己打开的终端是正常的 自带的终端:

    (base) ➜  ~
    

    vscode 终端:

    (base) (base) ➜  ~ 
    
    3 条回复    2024-02-24 10:17:45 +08:00
    NoOneNoBody
        1
    NoOneNoBody  
       66 天前
    你的终端应该有个加载脚本,vscode 上终端时加载了一次,然后在加载解析器时又加载了一次?
    jerrywaffle
        2
    jerrywaffle  
       65 天前
    这题我会:
    在 settings.json 加一行:
    "terminal.integrated.shellIntegration.enabled": false,

    另外,如果要设定 default python env
    "python.defaultInterpreterPath": "~/anaconda3/path/to/your/env/bin/python",

    再附送一个配置,运行 line or selection in ipython
    "python.terminal.launchArgs": ["-m", "IPython", "-i", "--no-autoindent"],
    huc2
        3
    huc2  
    OP
       63 天前
    @jerrywaffle 谢谢大佬,关了这个确实不会显示两个环境了。但我还是好奇,之前明明可以打开一个新 shell 的时候自动激活 python 指定环境的(不会出现两个环境的情况),不知道为什么前几天就出现两个环境了;现在关了后如果自己要输命令跑还得自己激活一下
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2473 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 16:04 · PVG 00:04 · LAX 09:04 · JFK 12:04
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.