Activating Anaconda Environment in VsCode
If Anaconda is your default Python install then it just works if you install the Microsoft Python extension.
The following should work regardless of Python editor or if you need to point to a specific install:
In settings.json edit python.path with something like
"python.pythonPath": "C:\\Anaconda3\\envs\\py34\\python.exe"
Instructions to edit settings.json
Working with Anaconda in Visual Studio Code
Activating a conda environment does not place conda
on your PATH
. You need to launch the Anaconda Prompt
app from your Start menu to get a command-line with conda
on your PATH
if you didn't check the box to include conda
during installation.
Also realize that conda
only supports PowerShell as of conda
4.6 which was released in January 2019.
And the Python extension for VS Code works with conda
fine. Create a conda
environment and the extension will allow you to select it as your environment/interpreter.
How to activate conda environment in VSCode on Windows 10
Your '$' indicates to me that you are not actually having a Command Line prompt open, but rather an alternative (probably bash?).
Press Ctrl+Shift+P and search for 'Select default shell', change to Command Line prompt and you should be good to go :)
Visual Studio Code terminal doesn't activate Conda environment
First, open the Anaconda prompt (How to access Anaconda command prompt in Windows 10 (64-bit)), and type:
conda activate tom
To activate your virtual environment.
Then to open Visual Studio Code in this active environment, type
code
And it should work.
Related Topics
How to Do Row-To-Column Transposition of Data in CSV Table
Rotate Image and Crop Out Black Borders
Python: How to Remove Empty Lists from a List
What Exactly Is the Point of Memoryview in Python
Pycharm Import External Library
Convert a Python Dict to a String and Back
Will Ordereddict Become Redundant in Python 3.7
Pivot String Column on Pyspark Dataframe
How to Resize an Image with Opencv2.0 and Python2.6
Python Regular Expression Pattern * Is Not Working as Expected
Extracting Specific Columns in Numpy Array
How to Understand the Output of Dis.Dis
Search by Objectid in Mongodb with Pymongo