-1

How to convert the following codes in VS Code terminal?

conda create -n cluster_topic_model python=3.7 -y
conda activate cluster_topic_model
SaNa
  • 333
  • 1
  • 3
  • 13
  • does this post help? https://stackoverflow.com/questions/61986052/visual-studio-code-terminal-doesnt-activate-conda-environment – JonSG Jan 25 '23 at 21:17
  • This is what I did. Open your VSCode to your desired directory. Then press`Ctrl+Shit+P` which opens a section prompting which interpreter to use. Select the python interpreter of your choice. Now assuming you have Anaconda installed on your local device. Now you should again press `Ctrl+Shit+P` and choose your Python kernel as `(base)` which has the `conda` environment. Now go to the `Terminal` tab on the menu bar and open a new terminal. Crucial part: You have to open a `cmd` terminal now and then you can go ahead with your code. – Gautam Chettiar Jan 25 '23 at 21:19
  • 1
    What happened when you tried to run that code as it already is? – Charles Duffy Jan 25 '23 at 21:24
  • 1
    Thanks so much @Gautam Chettiar, it worked; would you like to add your comment to the answer section? – SaNa Jan 25 '23 at 21:25
  • Sure, ill add the comment as it is. – Gautam Chettiar Jan 25 '23 at 21:26
  • @ Charles Duffy, it would say conda is not recognized! – SaNa Jan 25 '23 at 22:10

1 Answers1

1

The same has been provided in the comment as well. Leaving it here for the rest.

This is what I did.

  1. Open your VSCode to your desired directory.
  2. Then press Ctrl+Shit+P which opens a section prompting which interpreter to use.
  3. Select the python interpreter of your choice.
  4. Now assuming you have Anaconda installed on your local device.
  5. Now you should again press Ctrl+Shit+P and choose your Python kernel as (base) which has the conda environment.
  6. Now go to the Terminal tab on the menu bar and open a new terminal.

Hope this helps!

Crucial part: You have to open a cmd terminal now and then you can go ahead with your code.

Gautam Chettiar
  • 449
  • 2
  • 11