OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Working with Anaconda in Visual Studio Code

  • Thread starter Thread starter BernardL
  • Start date Start date
B

BernardL

Guest
I am getting a bit confused here, the latest Anaconda Distribution, 2018.12 at time of writing comes with an option to install Microsoft Visual Studio Code, which is great.

When launching VSC and after Python: Select Interpreter and with a fresh install of Anaconda, I can see ~Anaconda3\python.exe which I assume is the Anaconda Python Environment, however, when I try to run some commands, I am getting:

Code:
PS ~\Documents\Python Scripts\vs> ~/Anaconda3/Scripts/activate
PS ~\Documents\Python Scripts\vs> conda activate base
conda : The term 'conda' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

Now I know that it might be related to the environment variables but I find it highly odd as during the Anaconda installation, there are specific mentions that it is not required to add the Anaconda path to the environment variables. However after the error, the integrated terminal manages to launch Python and I am able to run code.

Next in line is that I am unable to view any variables in the debugger after running a simple script, as shown in the tutorial here:

Code:
msg = "Hello World"
print(msg)

I do expect to see similar results as shown in the link such as the dunder variables, I have also updated my launch.json with stopOnEntry = True following the steps.

I would like to know if it is possible to use Visual Studio Code with Anaconda as a interpreter without registering variables from the original distribution and if I am missing out anything required.

I expected the experience to be more straight forward but also I might be missing something, I am running on Windows 10.
<p>I am getting a bit confused here, the latest Anaconda Distribution, 2018.12 at time of writing comes with an option to install Microsoft Visual Studio Code, which is great.</p>

<p>When launching VSC and after <code>Python: Select Interpreter</code> and with a fresh install of Anaconda, I can see <code>~Anaconda3\python.exe</code> which I assume is the Anaconda Python Environment, however, when I try to run some commands, I am getting:</p>

<pre><code>PS ~\Documents\Python Scripts\vs> ~/Anaconda3/Scripts/activate
PS ~\Documents\Python Scripts\vs> conda activate base
</code></pre>

<blockquote>
<p>conda : The term 'conda' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and
try again. At line:1 char:1</p>
</blockquote>

<p>Now I know that it might be related to the environment variables but I find it highly odd as during the Anaconda installation, there are specific mentions that it is not required to add the Anaconda path to the environment variables. However after the error, the integrated terminal manages to launch Python and I am able to run code.</p>

<p>Next in line is that I am unable to view any variables in the debugger after running a simple script, as shown in the tutorial <a href="https://code.visualstudio.com/docs/python/python-tutorial" rel="noreferrer">here</a>:</p>

<pre><code>msg = "Hello World"
print(msg)
</code></pre>

<p>I do expect to see similar results as shown in the link such as the dunder variables, I have also updated my <code>launch.json</code> with <code>stopOnEntry = True</code> following the steps.</p>

<p>I would like to know if it is possible to use Visual Studio Code with Anaconda as a interpreter without registering variables from the original distribution and if I am missing out anything required.</p>

<p>I expected the experience to be more straight forward but also I might be missing something, I am running on <em>Windows 10.</em></p>
 

Latest posts

J
Replies
0
Views
1
Jeff P Chacko
J
Top