skip to Main Content

I have been using Python on vs code, and it worked fine. But the other day I came across some issues while importing some libraries and the code suggested the use of conda to run the code. I clicked on it and program ran, but now the issue is that every time I run a python program, it automatically runs a conda active kind of command, and a big error appears, I just want to remove this conda setting and start running python programs like before, but I cant figure out where that setting was on vs code, please help me out here.This is the Error and message

2

Answers


  1. It seems like you don’t have conda installed on your system so the text in red is letting you know that.

    Conda is an environment and package management tool for Python applications. You can install conda for your operating system by following the instructions in the site linked above. But keep in mind, I’ve linked miniconda which is a minimal setup of the Anaconda package and environment management tool.

    Have you created a new virtual environment to install your dependencies for your current Python code? If no, I’d highly recommend creating one, for more information you can read through this blog post.

    You could try to find out if you have conda installed by running this command in your terminal/command prompt:

    conda --version
    

    If you see something like "conda version-number" displayed after you ran the command, you have conda installed.

    Then, since it seems like you’ve activated an environment and left that activated. So you can deactivate the currently active environment and activate other environments to be able to run your other projects. To deactivate an environment, you can run the below command in your terminal:

    conda deactivate <name-of-the-env>
    

    To get the name of your environment, run this:

    conda env list
    

    Try these steps and see if you’re able to run your code.

    Login or Signup to reply.
  2. First of all, your terminal does not recognize the conda command, which means that your machine is not equipped with Conda or your environment variable is not configured well.

    As far as your problem is concerned, it may be caused by the following setting, and setting it to false should solve the problem.

        "python.terminal.activateEnvironment": false,
    

    In addition, you are using CodeRunner to execute the script. I suggest you use the official extension Python.

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search