Intellisense not working for python - python

Intellisense and Snippets for Python are not working after installing python by donjayamanne's extension (ext install python) on vscode 1.8.1. Even pressing ctr+space, it just keeps "Loading..." and nothing happens.
I just just installed this new arch Linux with python-3.6 and new kernel's version. And once VSCode version 1.8.1 finished installing, I installed this extension, then Intellisense and Snippets for python stopped working, however they were working fine last week on the old version of Arch Linux.
I tried many things, I uninstalled both vscode and the extension many times, I changed the path as said here , and now I removed the current kernel (4.8) and installed 4.4-lts, yet nothing happened.
I thought of asking here before I go here to report an issue.

Good news! The owner of the extension updated it and now it's good and working for python-3.6. Just install the new update.

Related

Python import not found after VSCode restart

My Python import could not be found after i changed the directory and restarted VSCode.
I installed the package via cmd (pip install ) and it was found in Vscode.
I restarted VSCode because i changed the file location to a other directory. The package wasnt found since then. I uninstalled the package and installed it via Powershell but it wouldnt work. Updated the pip installer.
Created a new file with in the directory where it has been before and installed the package again.
VSCode doesnt recognize the package anymore.
Import "" could not be Resolved (Pylance(reportMissingImports))
Does anybody know why this behavious appears and how to fix it?
I havent found a proper solution on here or another forum
In the bottom right of your VS code instance, you'll see something like 3.11.0 64-bit, which indicates the version of Python that VS code is referring to when running and linting your code. The problem is you installed the package with a different version of Python. If you click on the aforementioned button (that says 3.11.0 64-bit) you should see a list of options show up for the different Python versions installed. You need to change to the one that you installed the package on.

Python runs as a "runaway" process on MacOS when exiting Visual Studio Code

Thought I would ask here before submitting a bug report. I have just started running python3 with pandas on MacOS (Catalina) using VSCode. I have been noticing that when exiting VSCode, python starts to eat up CPU cycles on MacOS. I have to use the kill command. I am unsure if this is a misconfiguration of VSCode on my part. (I can't find anything that stands out.) Just wondering if someone out there could walk me through some steps to check with VSCode to make sure I did not configure something incorrectly.
python 3.9.4 installed through brew package manager.
VSCode 1.55 (March 2021)
MacOS 10.15.7
It appears that I have python 3.8.2 and python 2.7.16 installed as well, but wasn't sure about removing without losing some underlying MacOS function.
Thanks

Desktop VSCode vs Anaconda VSCode?

I have vscode installed on my computer already. I noticed a while back that it is now included with the anaconda distribution. Is there any benefit to using the vscode included with anaconda vs the vscode i already have installed?
FYI im a python developer if that makes a difference.
As far as I know, VS Code is an independent (in terms of your question!) software which is just shipped with Anaconda. It does not matter if you install them separately or first install Anaconda and install VS Code from there. Anaconda add some extensions by default to VS Code, but you can always install them yourself.
What you can do is updating your VS Code when new versions are released (see https://code.visualstudio.com/)
Also, VS Code is a code editor and one might use it with Python installed from for instance python.org or Anaconda distribution. You can tell VS Code what is your Python path in the settings.
And finally you may want to read this (quoted form https://docs.anaconda.com/anaconda/user-guide/tasks/integration/vscode/):
VS Code is free for both private and commercial use, runs on Windows, macOS and Linux, and includes support for linting, debugging, task running, version control and Git integration, IntelliSense code completion and conda environments.
VS Code is openly extensible and many extensions are available. When you install VS Code with Anaconda it comes with the Python Extension for Visual Studio Code for editing Python code, and the RedHat YAML extension for editing YAML files such as conda configuration files.
When installing Anaconda, you may select whether to install VS Code. VS Code is not offered during silent mode Anaconda installs, but you can easily install VS Code after the Anaconda install completes.

Anaconda update for Spyder has failed

Windows 10, 64 bit Anaconda 4.2, Python 3.5
I opened Spyder today to do some work. (so much for that idea, several hours later)
Spyder gave notice that there was new (3.1) version. I was on 3.0.2
So, I tried updating
conda update spyder
but it told me that it needed to DOWNGRADE it because of dependencies (I think, I wasn't taking notes at the time - so much for optimism)
Then I tried to update conda but that made things worse at this point, Spyder wouldn't start at all.
So, I uninstalled everything. At least, I think I did.
I went through Windows Programs and looked for anything that looked like it might be part of Anaconda, python, or Spyder.
I tried reinstalling Anaconda.
I got the 3 error messages about menus, path, and directories (there's a bunch of tickets on those). My path is short (800 characters or so) and my user name is in English.
I uninstalled and tried again.
Same results.
I created and ran the Fix.bat
"C:\My_Stuff\Program_Files\Anaconda3\pythonw.exe" -E -s "C:\My_Stuff\Program_Files\Anaconda3\Lib\_nsis.py" addpath
"C:\My_Stuff\Program_Files\Anaconda3\pythonw.exe" -E -s "C:\My_Stuff\Program_Files\Anaconda3\Lib\_nsis.py" mkdirs
"C:\My_Stuff\Program_Files\Anaconda3\pythonw.exe" -E -s "C:\My_Stuff\Program_Files\Anaconda3\Lib\_nsis.py" mkmenus
and that at least gave me my menus.
From a command prompt (either Anaconda or Windows),
conda list
shows no packages.
Spyder and Anaconda Navigator do not start ("This application failed to start because it could not find or load the Qt platform plugin "windows"
in "".)
Typing python from a command prompt (either one) appears to work and references Anaconda 4.2.0
I'm going around in circles.
Any help appreciated.
Craig
I had posted this on Github too, as I ran into a larger problem while trying to get my system back.
The last comment from that thread (https://github.com/conda/conda/issues/4369) is repeated here:
I have, I believe, successfully installed Anaconda 4.2 64bit Python 3.5 version
I uninstalled the software again using the Windows 10 uninstall from Programs and Features.
I manually removed the Anaconda paths from the user PATH variable.
I manually removed the Anaconda folder from the Startup menu.
I manually removed selected references to Anaconda in the registry.
(I did not see the Anaconda clean program until later - https://docs.continuum.io/anaconda/install)
I rebooted.
I installed from the exe I had downloaded last year (4.2)
This time, I installed for all users, not just me.
Testing
`conda list
returns many packages. Yeah!
Calling python from a command prompt works too.
Spyder starts and remember my previous project, so that is nice too.
I think I can work again.
I may need to upgrade some packages, so hopefully that will go well too.
Craig

Problems in fully uninstalling Python 2.7 from Windows 7

some months ago, I installed Python 2.7 on my laptop (my os is Windows 7).
After, I decided to use Python xy 2.7.3 instead of 'pure' Python; so, as suggested, I removed Python 2.7 and tried to install Python xy 2.7.3. However, when I tried to run the .exe file for installation, a warning window appears telling me that Python 2.7 is already installed on my computer. I tried to install a different version of Python xy (2.6) and everything went fine; however, I'd really prefer to use the latest version of Python xy.
Actually, I can't figure out what went wrong whie uninstalling Python 2.7; does someone have any clue?
I can tell you that I followed the 'normal' procedure for programm uninstalltion; control panel -> Programs -> Remove Program
Thanks in advance
Stefano
Run regedit, backup and delete the registry keys:
HKEY_LOCAL_MACHINE\Software\Python\
HKEY_CURRENT_USER\Software\Python
My problem occurred when changing from Canopy to Python(x,y).
So, also delete all folders that are left behind when uninstalling.
https://support.enthought.com/entries/23580651-Uninstalling-Canopy
I also had this issue as well. It was due to third party installs. Even though you have uninstalled python, it leaves all the third party libraries that were installed and I think Python(x,y) just detects the directory.
To fix, uninstall Python 2.7 and then check to see if C:\Python27 still exists. If it does, go ahead and delete and then try installing Python(x,y). That is what worked for me.
I faced this issue: I tried to uninstall the python and fresh install, reason my pip version issue was not getting resolved. So I deleted the python folder, removed python from system path, and when I tried to uninstall from "Uninstall a program" in control panel, it showed "Windows installation package" error window and could not clean uninstall.
Solution what i found was: In the "Uninstall a program" select python and click repair. And then uninstall the python, it worked for me. Hope this helps and save some time.
PS: I am pretty new to python, and any help correcting me would be appreciated.
Maybe to put an answer out there.
Uninstalling anything from windows can have multiple side effects residing completly on your specific machine. As to what is common:
-> Python sets itself in your windows path. Here is how to modify your windows path: http://www.computerhope.com/issues/ch000549.htm
It means that there is a probability that python is gone but the path entry might not be. That is a guess however -> more information needed
-> Are you sure that everything was removed from your computer? If you already did the normal uninstalling process - try to look up if any python directory is still present.
-> Thirdparty installed? Have you downloaded any libs that are still on your machine.
Besides from that - it could be anything - the more information you give us the more we can say about it.
Maybe this post will help you: How to completely remove Python from a Windows machine?
I had python 2.7.12 and wanted to uninstall it for 2.7.9. I had the same problem as you and to fix it I tried to delete all of the local files and then uninstall however it still gave me the same error. So instead I decided to repair the python 2.7.12 and then uninstall which worked perfectly and completely got rid of the error.
I had python 2.7 installed and enthought canopy. I wanted to switch to python(x,y) to access a full version of the OpenCV library. python(x,y) installation complained about python 2.7 already being installed after:
1)Using windows control panel
2)Removing all lingering python files
3)Removing the windows path as suggested above
Not until I removed all registry entries related to python/enthough did python(x,y) install without issue.
I installed Enthought before. When I wanted to install Python(x,y) instead, I met the problems above.
After I had tried to uninstall Enthought and Python(x,y) from the Control Panel and then restart the PC, the problem still occured the next time I installed Python(x,y).
I solved this problem by:
deleting all the relevant files in C:/User/UserName/AppData/ about Python, including the third party softwares like Enthought;
deleting the Path in user and system Environment;
=====the two steps were failed if I didn't do the third step.=====
deleting the register keys as #Daniel said. (include all the relevant keys with the prefix py if you installed the third party software about Python. )
HKEY_LOCAL_MACHINE\Software\Python\
HKEY_CURRENT_USER\Software\Python
Locate that set up file which was used to install Python. Run it and choose repair. If that doesn't solve the problem. Go to c:\Python(x,y) and delete this folder completely by shift+Del.
Run that set up file again and click on "Change" which will ultimately install the Python again. By default in my case option to add path and making that version of Python the default on my system was unchecked which can be figured out by seeing the red cross mark in one of the installation screen. Click on it if you want set up to make it default Python version and also click on the option to indicate you want the path to be added in windows environment variable.
No need to touch registry as previous ones will be overwritten again.
In my case it worked. I was getting error like:
Fatal Python error: Py_Initialize: unable to load the file system codec
LookupError: no codec search functions registered: can't find encoding
Besides that un-installation was failing from control panel. So above steps solved all of my problem. Hope it helps.
I Repaired/Modified to install all the components for the Python
version I wanted to uninstall.
Once that was done, I clicked on Uninstall/Change and that uninstalled it for good.

Categories