![]() I misinterpreted that as something that's an issue. ![]() There's no issue with VS Code doing that since this is the default behavior. In the question, I have also talked about VS Code activating Conda environments automatically. Now, modify these two files as per the instructions. Also, to access these two files quicker, open them like this with VS Code: code ~/.bashrc or code ~/.bash_profile. bash_profile, you can follow the above instructions. You should now see these files when you again type: ls -a But if one is not there or if both are missing create them using: touch. If they are, you are ready to follow the above instructions. Enter this command: ls -a and you will see all your files, even hidden ones.Just type this and you will be in your home directory Open Git Bash and go to your home directory with: cd.bashrc, put this code: # > conda initialize >Įval "$('' 'shell.bash' 'hook')" bashrc (as already mentioned) or if you want, just simply follow this: put this code in your. So you can just cut and paste the code from. bash_profile and it is usually sourced by Git Bash, but VS Code Git Bash terminal will use. So, to sum up, using conda init bash will put the conda command in the. bash_profile by conda init bash and paste it into your. ![]() So what you actually need to do is take the code that is put into. bashrc file is the file that is sourced when creating a Terminal session in VS Code. bash_profile is only sourced during the main Bash session. bash_profile is NOT sourced in VS Code since. But the integrated Terminal in VS Code is a subshell of a Git Bash session. bash_profile since it is sourced during logging into Bash. So the issue was that when I ran the command conda init bash in Git Bash or the VS Code Terminal, Conda just basically put the command used for activating Conda environments in the. First of all at the time of writing the question I was using Git Bash as my Terminal in VS Code (am still using it). I have figured out the answer myself and would like to share it here. In other words, Anaconda and Conda work perfectly outside of VS Code terminal. P.S I have tried using conda activate in CMD and also in Git Bash and they work without any issues. Unexpected warning in CMD when running Anaconda Python interpreterĪutomatically run Anaconda Scripts and conda activate base when opening new Terminal in VS Code # !! Contents within this block are managed by 'conda init' !!Įval "$('/C/Users/User/Anaconda3/Scripts/conda.exe' 'shell.bash' 'hook')" Anyway, this is what is in my bash profile I think it has to do something with this bash profile. If using 'conda activate' from a batch script, change yourĪnd then I am told to initialize my shell, so I did conda init bash but still no luck. It states Your shell has not been properly configured to use 'conda activate'. But when conda activate base is run, automatically, as mentioned, I get a CommandNotFoundError. Now, when I open a new Terminal in VS Code, automatically C:/Users/User/Anaconda3/Scripts/activate is run and then conda activate base is run. But first I would like to mention that I have checked "Add to PATH" when installing Anaconda so no issues there. Anyway, there's another problem in VS code. This Python interpreter is in a conda environment, but the environment has not been activated. If I type and enter python in cmd, the Python interpreter provided by anaconda comes up. One of the first issues that I see is when I am using CMD to run Python. There are a couple of issues that I am facing. But I have run into some issues when using the integrated Git terminal in VS Code with the Anaconda Python interpreter. So I clean installed Anaconda and am now using it as my default Python interpreter and also using Conda for installing packages and making virtual environments. I want to learn Data Science and so have used some really popular Python modules likes Pandas, Matplotlib, Numpy, etc.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |