[Python] Can't use Miniconda on VSCode properly anymore

Discussão em 'Python' iniciado por Stack, Julho 28, 2025.

  1. Stack

    Stack Membro Participativo

    I want to say that I’m not a computer expert. I use Python for biostatistics, and for years I’ve been working with virtual environments made with Miniconda, running my Python code in VSCode. For a few days now, I have had a serious problem that is putting my work at risk. I can't run my code anymore.

    I typically use a PowerShell terminal in VSCode, but now I keep getting the following error message:

    & : Cannot load the file C:\Users\cedri\anaconda3\shell\condabin\conda-hook.ps1 because script execution is disabled on this system. For more information, see about_Execution_Policies at https://go.microsoft.com/fwlink/?LinkID=135170.
    At line:1 char:4
    + (& C:\Users\cedri\anaconda3\shell\condabin\conda-hook.ps1) ; (conda a ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : SecurityError: :)) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess


    I’ve tried every solution I could find: changing the execution policy in PowerShell, running conda init powershell, reinstalling both VSCode and Miniconda, and even doing a full factory reset of my computer but nothing works. This error keeps showing up. Everything had been working perfectly fine for over three years!

    I also tried switching the terminal from PowerShell to cmd, but when I do that, my code runs extremely slowly. Previously, when running a script (the example is just an average requests.get(url), it was fast and looked like this:

    C:\Users\vroum\OneDrive\Documents\Race_Core>C:/Users/vroum/miniconda3/Scripts/activate
    (base) C:\Users\vroum\OneDrive\Documents\Race_Core>conda activate pr23

    (pr23) C:\Users\vroum\OneDrive\Documents\Race_Core>C:/Users/vroum/miniconda3/envs/pr23/python.exe c:/Users/vroum/Downloads/Code/Code/parsingfcloop.py

    <Response [200]>


    But now, for the same kind of code, I get this with an extremely slow runtime:

    C:\Users\cedri\OneDrive\Documents\Marble project>C:\Users\cedri\anaconda3\Scripts\activate.bat env_1

    (env_1) C:\Users\cedri\OneDrive\Documents\Marble project>conda run --live-stream --name env_1 python "c:/Users/cedri/OneDrive/Documents/Marble project/test.py"
    <Response [200]>


    What is this --live-stream --name thing? As you can probably tell, I don't fully understand what’s happening under the hood here, and I’m feeling completely overwhelmed. After working in the same environment for more than three years, having everything fall apart like this is incredibly frustrating. I really want to understand what’s gone wrong and how to fix it but I need help.

    Continue reading...

Compartilhe esta Página