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.
Question posted in Visual Studio Code
View the official documentation.
View the official documentation.
2
Answers
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:
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:
To get the name of your environment, run this:
Try these steps and see if you’re able to run your code.
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.In addition, you are using CodeRunner to execute the script. I suggest you use the official extension Python.