How to reconfigure VSCode for python - python-3.x

I had configured VSCode for python, it was working fine, linter , autopep all the things were working fine. After some days I installed Anaconda, from here problems started, after this I got error that Select Python Interpreter at the bottom of VSCode, I added python path to the settings,then it works fine but "Select Python Interpreter" error was still coming. Some days before I installed Javascript extension, after this linter,autopep nothing is working,only using python command line python program is getting run.
I removed javascript extension,again installed VSCode, now the things are worst,nothing is working now.Please anyone help me to how to reconfigure VSCode to work properly.Even I removed Anaconda installation too, still problems not solved. I searched online but did not get any proper inforamtion.

I had a similar issue, I think you have both Python 3.7 and Anaconda installed separately, Use any one them , remove the other. When both of them is together it was throwing lot of issues. I would prefer to remove Anaconda(pure personal choice).If you don't have much customized settings in VScode, delete its user configuration files and set it up again. it will work

Related

VSCode doesn't recognize python interpreter

I am on arch linux, and for some reason VSCode doesn't find the python interpreter.
I have tried to set the python interpreter path to to be right (/bin/python3), and if I actually run a file then it works, but the python extension says I need to download python before using the extension and the auto complete doesnt work. Any Ideas? Any ways to debug this issue?
I'm having a similar issues, downgrading to Electron9.3.3-1 solved the issue for me while waiting for a potential fix.
Source: GitHub Issue
I found my solution with vscode-insiders. The current vscode python extension is already move on to rely on jupyter, another extension available only on vscode insiders.
Plus the vsc insiders logo looks cool..

Issues with Path, installing packages, Conda environments, and several built-in commands

I've recently upgraded my PC with various bits and pieces and installed Windows 10 Pro. Most of what I do is data science related, but that's irrelevant.
I've had several issues with Anaconda 3 installations, my Path variables, installing various packages, and several Windows commands that I understood to be built-in:
Obviously, virtual environments are popular, and I've been using conda environments to run basic code without issue, however, several very key libraries are giving me issues when I try to install them. The first one I ran into an issue with was the very standard and presumably easy-to-install matplotlib, however, the issue I ran into here and am still getting is that chcp is not recognized as an internal or external command.... When I run where chcp as admin I have no issues. chcp will run without error as well, but as soon as stop cmd as admin, chcp nor where commands work whatsoever. I don't get it. I've done just about everything I can to the Path variable that I've seen online, and nothing has worked. Uninstalled and reinstalled. Nothing has changed.
Furthermore, isn't Anaconda supposed to come pre-installed with these?
note where does not return an error that would indicate that it's looking in the wrong directory; I get an exit code DNE 0 due to the command apparently not existing outside of admin privileges in \System32. Makes no sense to me and haven't found anything like this/ a vague resemblance of a solution elsewhere.
So with all of that in mind:
what might be causing this issue? Permissions? Locations? Something I'm missing from the Path variables? etc. Fixing the issue with chcp should do it for me.
How can I get the Anaconda "package" to, well, work? -> I can get the launcher, Jupyter notebooks, etc., but what I'm referring to here is the set of packages for Python itself -- that's why I went for Anaconda to begin with.
Thanks in advance.

Unable to get python3 to work in Git on Windows10

I have installed the latest windows 10 version of Git v 24 and use the standard recommended install as shown on a number of websites including https://zarkom.net/blogs/how-to-install-git-and-git-bash-on-windows-9140
he has said that his install recommends for vers 19 are still ok for v24 and just click on Next etc. I have had this confirmed with other help guides but on install I type in after the $ sign either python and or python3 and nothing happens but I can see when running a test file the bash:
/c/Users/nigel/AppData/Local/Microsoft/WindowsApps/python3: Permission denied
I don't have python3 installed there but in standard C:\Users\nigel\AppData\Local\Programs\Python.
I have powershell running ok and am using Sublime Text 3 ok I can run code I prepare in Powershell version 5.6.. whatever it is now standard install part of Windows10. No issues running Python IDLE either.
When I search the reg with regedit and type in git bash I cannot trace this odd link to Microsoft/*/Python as above but in that folder there is an odd link not seen previously not sure what installed that other than sometime ago I might have started an instll of python via M store but sure I didn't but this odd python language server may have got installed through something else?
C:\Users\nigel\AppData\Local\Microsoft\Python Language Server\stubs.v1 is all I can find but in windowapps I found 0kb of a couple of files that are odd ie python.exe and python3.exe and size says 0kb.
I cant seem to find how to amend git so that it stops looking in this odd location and looks in correct folder as stated above ie C:\Users\nigel\AppData\Local\Programs\Python
I would appreciate any help although I am using powershell and ST3 ok on my python courses on UDEMY. I have tried to look at environmental path etc but cant see any reference to this odd path link with windowapps ? I have amended path ok previously for other editors or ensured that the path was pointing to correct python. The only other version of python I have is with Jupyter/ananconda but that is self contained my word ie it doesn't fire up unless I am in Anaconda or jupyter hope that makes sense which I use on another course ie bootcamp course

Spyder external system terminal does not work (Python3.6)

I am not sure if this is a right place to ask this type of questions. I am a python beginner or programmer overall at this point. I am using Spyder to use python 3.6 (via Anaconda). I wrote a code that works fine when I run it in the current Ipython console. But I really need to run it in an external system terminal. In order to do so, I chose the following path: Run-> configuration per file -> execute in an external system terminal. That has been working fine. But now it refuses to work!
I validated that there is nothing wrong with my code by running something simple and saw that running via external system terminal does not work.
So far I deleted Anaconda and re-installed it. Could someone suggest what I should be looking for to diagnose the problem and fix it?
Thanks!
I had the same problem and noticed that unless the Working directory settings is set to "The directory of the file being executed", it won't work.
You can change it in "Run" > "Run configuration per file".

PyCharm: IDE does not seem to recognise Python 3 even with 3.x interpreter set

I am using the latest version of Pycharm(pycharm-2017.1) and have used Pycharm for a couple of years without issue. However, I have never written Python 3 scripts with it before, and have issues now. I am getting red underlined syntax errors which appear to clearly indicate that Pycharm doesn't understand that I'm using Python 3.
In 'Edit configurations', I have set Python 3.x to be the default interpreter... I'm not sure what I'm doing wrong.
Note: I have the correct python3 shebang lines in my scripts, and running them both straight from a terminal, or even by pressing 'run' in Pycharm works no problem.. this latter fact just adds to the mystery.
I also tried adding (with the '+' in 'Edit configurations', specific profiles for each of the scripts concerned, with Python3.x as the interpreters, to no avail)
Thanks for reading
The Edit configurations settings refers to the running options only.
To use python3 at project level you need to change the interpreter in File > Settings > Project: project-name > Project Interpreter
This allow to have correct syntax-checking, import-checking and others

Resources