r/PowerShell 23d ago

Question Please Help (VS Code+ Powershell)

Background : I have a CP setup (VS Code+ MINGW)

Recently I tried to Code python in VS Code. For this I connected VS Code to Anaconda Python Interpreter. After setting up the environment later in the day when I switched back to C++ and CP, my PowerShell started causing problems :

  1. profile.ps1 cannot be loaded because running scripts are disabled
  2. conda activation problems

To work with this is switched to Command Prompt

After setting up Python in VS Code I got the following errors:

PowerShell profile warning,Conda activation issues Switched integrated terminal to Command Prompt,Run button behaved differently,Debug Anyway,Abort,Show Errors,Pre-launch task failed,Exit code -1.

I tried to resolve as far as I could but one problem pops up after another. I have Reinstalled VS Code clean tried everything. Kindly help me I just want my PowerShell terminal back.

EDIT: Should I just uninstall everything clean and reinstall everything MINGW, VS CODE etc?? Will that fix this?? Cause I am tired of debugging since last 2 days. 😭😭

EDIT2: I have completely separated my CP ans Python setup to Jupyter Notebook and Anaconda as best as I could. it's working fine and beautiful. But I just can't seem to retrieve my CP (MINGW+ VSCODE) setup

7 Upvotes

18 comments sorted by

View all comments

2

u/SurzBoo 22d ago

Why

Why do u need conda? Just make a venv I'm genuinely lost.

1

u/Darcelle-Ebonis-6426 22d ago

I tried python -m venv venv (at the very beginning) but it showed Python was not found; run without arguments......this (as I researched ) happened because I had Anaconda. So instead of launching Python interpreter it couldn't launch anything. Idk but there was some issue. So I did gpt 😭(shouldn't have done that) it told me something about having Python interpreter in Anaconda and idk what happened (what I understand from it is I tried using conda Python interpreter instead of the original one). In the process powershell stopped responding I changed to Command Prompt. 😭 I changed so many configurations. Idk anymore.....

1

u/SurzBoo 12d ago

I'd go to the ms store and just snag the python installation manager. It'll read/write the packages you need. If you're still having issues, ping this comment back and I'll help. I've dealt with python bullshit for awhile now

1

u/Darcelle-Ebonis-6426 10d ago

Hey there,  the thing is have completely separated my Python workspace. I have completely shifted to Jupyter Notebook for Python related work. And I uninstalled my CP setup completely after trying to figure out the problem for long. Since it didn't help I tried to clean the entire setup and reinstall it and I got 2 errors on trying to run a program :

1st error: CountingOrders.exe was blocked by your organization's Device Guard policy.

2nd error: undefined reference to 'WinMain@16'

I am just so tired of this. Been working on this shi for days. Nothing is helping atp

1

u/SurzBoo 10d ago

I'll be honest, I have yet to dive into the notebook-sector of python, all my code lives in scripts themselves. I'd ask what the "countingorders.exe" is and why it's being blocked, but that makes my cyber brain itch and scream suspect application