vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Virtual environment is not updating in VS Code Terminal

Open SleepyOwL00 opened this issue 3 years ago • 8 comments

I have created 3 virtual environment as you can see in the screenshot.

image Every virtual environment python version is different. When I try to activate the virtual environment "try" from vscode terminal. My python version does not change.

image

But When I tried to do the same thing in cmd the correct python version was showing.

image

Due to this python file showing error like this image

And when I try to install pandas in "try" environment, I get this message. (Note : pandas is already installed in python version 3.8)

image

This Issue only happening in vscode terminal. When I tried to installed the package from cmd there is not error.

image

SleepyOwL00 avatar Sep 16 '22 11:09 SleepyOwL00

I'm transferring it to VSCode as it's related to the terminal. Please send your User settings which is helpful for diagnosis. Did you try reopening VSCode?

karrtikr avatar Sep 16 '22 22:09 karrtikr

@karrtikr I did try reopening vscode multiple times but issue still the same. Regarding User setting how do I share that.

SleepyOwL00 avatar Sep 17 '22 16:09 SleepyOwL00

Regarding User setting how do I share that.

What do you mean? Try executing the command Open User Settings (JSON) and paste the contents of settings.json.

karrtikr avatar Sep 17 '22 17:09 karrtikr

` "python.autoComplete.extraPaths": [

],
"C_Cpp.updateChannel": "Insiders",
"kite.showWelcomeNotificationOnStartup": false,
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "choseToUpdateConfiguration",
"java.home": "C:\\Program Files\\Java\\jdk-11.0.10",
"java.help.firstView": "gettingStarted",
"window.autoDetectColorScheme": true,
"[java]": {

    "editor.suggest.snippetsPreventQuickSuggestions": false
},
"files.associations": {
    "*.COBOL*": "cobol",
    "*.COB*": "cobol",
    "*.COBCOPY*": "cobol",
    "*.COPYBOOK*": "cobol",
    "*.COPY*": "cobol",
    "*.PL1*": "pl1",
    "*.PLI*": "pl1",
    "*.INC*": "pl1",
    "*.INCLUDE*": "pl1",
    "*.JCL*": "jcl",
    "*.ASM*": "hlasm",
    "*.ASSEMBLE*": "hlasm",
    "*.HLASM*": "hlasm",
    "*.HLA*": "hlasm",
    "*.java": "java",
    "*.c": "c",
    "iostream": "cpp",
    "ostream": "cpp"
},
"editor.renderControlCharacters": true,
"hexdump.btnEnabled": false,
"python.showStartPage": false,
"editor.fontLigatures": true,
"vsicons.dontShowNewVersionMessage": true,
"window.title": "${dirty}${activeEditorShort}${separator}${rootName}${separator}${rootPath}${separator}${appName}",
"editor.hideCursorInOverviewRuler": true,
"editor.rulers": [
140
],
"editor.fontWeight": "400",
"files.exclude": {
    "**/.classpath": true,
    "**/.project": true,
    "**/.settings": true,
    "**/.factorypath": true
},
"python.analysis.extraPaths": [],
"[jsonc]": {
    "editor.defaultFormatter": "vscode.json-language-features"
},
"jupyter.alwaysTrustNotebooks": true,
"python.defaultInterpreterPath": "C:\\Users\\rahul\\anaconda3\\python.exe",
"notebook.cellToolbarLocation": {
    "default": "right",
    "jupyter-notebook": "right"
},
"security.workspace.trust.emptyWindow": false,
"security.workspace.trust.startupPrompt": "always",
"security.workspace.trust.untrustedFiles": "open",
"security.workspace.trust.banner": "never",
"jupyter.askForKernelRestart": false,
"security.workspace.trust.enabled": false,
"notebook.cellFocusIndicator": "border",
"notebook.cellToolbarVisibility": "hover",
"workbench.iconTheme": "material-icon-theme",
"Zowe-DS-Persistent": {
    "persistence": true,
    "favorites": [],
    "history": [],
    "sessions": [
        "Sleepy_OwL"
    ],
    "fileHistory": [
        "[SLEEPY_OWL]: Z03842.SEQDS",
        "[SLEEPY_OWL]: Z03842.INPUT(MYNEWMEM)",
        "[SLEEPY_OWL]: Z03842.SURPRISE(VIOLET)",
        "[SLEEPY_OWL]: Z03842.INPUT(M9)",
        "[SLEEPY_OWL]: Z03842.INPUT(M6)",
        "[SLEEPY_OWL]: Z03842.INPUT(M5)",
        "[SLEEPY_OWL]: Z03842.INPUT(AQUA)",
        "[SLEEPY_OWL]: Z03842.INPUT(M3)",
        "[SLEEPY_OWL]: Z03842.INPUT(TEST5)"
    ],
    "searchHistory": [
        "Z03842,ZXP.PUBLIC",
        "Z03842,ZXP",
        "Z03842",
        "Z"
    ]
},
"Zowe-USS-Persistent": {
    "persistence": true,
    "favorites": [],
    "history": [],
    "sessions": [
        "Sleepy_OwL"
    ],
    "fileHistory": [],
    "searchHistory": []
},
"Zowe-Jobs-Persistent": {
    "persistence": true,
    "favorites": [],
    "history": [],
    "sessions": [
        "Sleepy_OwL"
    ],
    "fileHistory": []
},
"json.schemas": [
    {
        "fileMatch": [
            "/zapp.json"
        ],
        "url": "file:///c%3A/Users/rahul/.vscode/extensions/ibm.zopeneditor-1.4.1/resources/zapp-schema-0.0.2.json"
    }
],
"zopeneditor.welcomePage.show": false,
"[html]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
},
"workbench.sideBar.location": "right",
"terminal.integrated.enableMultiLinePasteWarning": false,
"editor.largeFileOptimizations": false,
"editor.acceptSuggestionOnEnter": "off",
"editor.acceptSuggestionOnCommitCharacter": false,
"editor.snippetSuggestions": "top",
"editor.cursorSmoothCaretAnimation": true,
"diffEditor.codeLens": true,
"[javascript]": {
    "editor.defaultFormatter": "vscode.typescript-language-features"
},
"liveServer.settings.donotShowInfoMsg": true,
"explorer.confirmDragAndDrop": false,
"emmet.includeLanguages": {
    "django-html": "html"
},
"emmet.preferences": {

},
"emmet.showSuggestionsAsSnippets": true,
"workbench.tree.expandMode": "doubleClick",
"workbench.view.alwaysShowHeaderActions": true,
"breadcrumbs.enabled": false,
"editor.wordWrapColumn": 60,
"editor.unusualLineTerminators": "auto",
"editor.suggest.localityBonus": true,
"workbench.colorTheme": "Ayu Mirage Bordered",
"telemetry.telemetryLevel": "error",
"editor.renderWhitespace": "boundary",
"editor.wordWrap": "on",
"workbench.list.openMode": "doubleClick",
"workbench.tree.indent": 15,
"editor.renderLineHighlightOnlyWhenFocus": true,
"editor.inlayHints.padding": true,
"editor.language.brackets": [
	["[", "]"],
	["(", ")"],
    // ["<", ">"],
	["{", "}"]
],
"editor.bracketPairColorization.independentColorPoolPerBracketType": true,
"workbench.colorCustomizations": {
    "list.activeSelectionForeground": "#ffe600b4",
    "sideBarSectionHeader.foreground": "#ffd50093",
    // "terminal.background":"#090300",
    // "terminal.background":"#22221B",
    // "terminal.foreground":"#929181",
    // "terminalCursor.background":"#929181",
    // "terminalCursor.foreground":"#929181",
    // "terminal.ansiBlack":"#22221B",
    // "terminal.ansiBlue":"#36A166",
    // "terminal.ansiBrightBlack":"#6C6B5A",
    // "terminal.ansiBrightBlue":"#36A166",
    // "terminal.ansiBrightCyan":"#5B9D48",
    // "terminal.ansiBrightGreen":"#7D9726",
    // "terminal.ansiBrightMagenta":"#5F9182",
    // "terminal.ansiBrightRed":"#BA6236",
    // "terminal.ansiBrightWhite":"#F4F3EC",
    // "terminal.ansiBrightYellow":"#A5980D",
    // "terminal.ansiCyan":"#5B9D48",
    // "terminal.ansiGreen":"#7D9726",
    // "terminal.ansiMagenta":"#5F9182",
    // "terminal.ansiRed":"#BA6236",
    // "terminal.ansiWhite":"#929181",
    // "terminal.ansiYellow":"#A5980D",
    "sideBarTitle.foreground": "#ffd500be",
    "editorLineNumber.foreground": "#4183d99d",
    "editorLineNumber.activeForeground": "#40ff00b1",
    "editorBracketHighlight.foreground1": "#25e9ff",
    "editorBracketHighlight.foreground2": "#ffb32f",
    "editorBracketHighlight.foreground3": "#cd34fb",
    "editorBracketHighlight.foreground4": "#80ff00",
    "editorBracketHighlight.foreground5": "#208fe9",
    "editorBracketHighlight.foreground6": "#ff50b6",
    "editorBracketHighlight.unexpectedBracket.foreground": "#da0007"
  },
"editor.guides.bracketPairs": "active",
"bracketLens.color": "#99aa88",
"bracketLens.prefix": "    <- ",
"files.trimTrailingWhitespace": true,
"editor.minimap.size": "fit",

"editor.fontFamily": "Fira Code, monospace",
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false,
"terminal.integrated.fontFamily": "consolas",
"editor.codeLensFontSize": 7,
"terminal.integrated.mouseWheelScrollSensitivity": 0.5,
"git.confirmSync": false,
"editor.wordBasedSuggestions": false,
"comments.openView": "file",
"explorer.openEditors.visible": 8,
"terminal.integrated.tabs.defaultColor": "terminal.ansiGreen",
"editor.tabSize": 2,
"editor.tabCompletion": "on",
"typescript.format.semicolons": "insert",
"terminal.integrated.detectLocale": "on",
"terminal.integrated.inheritEnv": false,
"python.terminal.activateEnvInCurrentTerminal": true,

`

SleepyOwL00 avatar Sep 17 '22 19:09 SleepyOwL00

Why do you keep closing the issue, is your issue resolved?

karrtikr avatar Sep 17 '22 19:09 karrtikr

@meganrogge We don't control the VSCode terminal so this is being caused due to likely some configuration in VSCode.

karrtikr avatar Sep 19 '22 14:09 karrtikr

does changing "terminal.integrated.inheritEnv": false, to true change this?

meganrogge avatar Sep 19 '22 17:09 meganrogge

does changing "terminal.integrated.inheritEnv": false, to true change this?

No, issue still remain the same.

SleepyOwL00 avatar Sep 21 '22 10:09 SleepyOwL00

@karrtikr I don't know how conda works exactly, but I would guess the issue here is python 3.8.5 is ahead of the conda bin in $PATH. I don't think this is actionable for us as we just present what cmd/powershell tell us, moving back to you if you want to follow it up, I consider this out of scope on our side though.

Tyriar avatar Sep 22 '22 13:09 Tyriar

python 3.8.5 is ahead of the conda bin in $PATH

The question is why is $PATH is different in VSCode terminal and the external cmd terminal? I don't think extension can do anything about this so closing it if you consider it out of scope.

karrtikr avatar Oct 14 '22 21:10 karrtikr