VS Code Pylance works slow with much delay - python

When I try to use the autocomplete using Pylance it is stuck there for some time
and After Some time like 3 ~ 5 seconds the pop up with auto-complete shows up
Python Language Server is already set to Pylance
What I've tried so far.
Reinstall Python Extension.
Reinstall VS Code
Restarted Python Language Server
Reset VS Code
Reinstall Pylance.
But None of the above seems to work

It works well on my computer, how do you open this python file?
Try moving your code to its own folder and opening that up instead of opening up some big folder that contains a lot of files. This does show a performance hole where large workspaces take a while to load.
You can refer to this page for more details.

Its works without problem on my computer, try Clean Uninstall Python and VSC
maybe you have some incorrect setting that slows down your computer or VSC performance

Related

Trouble with imports on Visual Studio 2022

What I get when I try to run it
Nothing I'm trying to import is being recognized by the IDE. I do have to admit, I am a fairly novice programmer, and the process of successfully importing external modules (, the ones that don't come with python,) is very confusing to me right now. But from everything I could scrap online, it seems like for VS 2022 I first have to go to [TOOLS] > [PYTHON] > [PYTHON ENVIRONMENTS]. Then from the environments popout I select my python version (, which is 3.10 (64-bit),) update my pip if not already up to date, search for my desired package and download. The terminal said the download completed but the IDE still can't find the import.
My installed packages in my python environment
This is a problem I've been putting off for months, and in the past I downloaded the packages through the Windows command prompt instead of the IDE. I'm not sure if it's any different, I'm not sure if one is more right. The result was the same regardless, it didn't work. And after several uninstalls and reinstalls, I even tried moving the entire package folder into my project folder to see if anything would change. The import was accepted but something in the packaged errored out. Moving files like that doesn't seem like the correct way anyway, I just want to make sure I bring up everything I tried to fix this.
I suspect that solution is something super simple that I'm just overlooking or don't know. I still kind of think the package needs to be with my .py file in some way but I'm unsure. If you can save me I'd appreciate it because I've been stumped for a while now.
I know my code is super simple, but I just wanted to show the error. I get the error before it prints.

Python VS code taking too much memory and taking too long to auto complete

I am a beginner learning to program python using VS code so my knowledge about both the VS code and the python extension is limited. I am facing two very annoying problems.
Firstly, when the python extension starts the memory usage of vs code jumps from ~300 mb to 1-1.5 Gbs. If I have any thing else open then everything gets extremely sluggish. This seems to me a bit abnormal. I have tried disabling all other extensions but the memory consumption remains the same. Is there a way (or some settings that I can change to reduce the memory consumption?
Secondly, the intellisense autocomplete takes quite a bit of time (sometimes 5-10 mins) before it starts to kick in. Also it stops working sometimes completely. Any pointers what could be causing that?
PS: I am using VS code version 1.50 (September update) and python anaconda 4.8.3.
VSCode as a code editor, in addition to the memory space occupied by VSCode itself, it needs to download the corresponding language services and language extensions to support, so it occupies some memory space.
For memory, it is recommended that you uninstall unnecessary third-party extensions and duplicate language services. In addition, this is a good habit if we use virtual environments in VSCode. The folder of the virtual environment exists in the project, and the installation package is stored in the project without occupying system resources.
For automatic completion, this function is provided by the corresponding language service and extension. please try to reload VSCode and wait for the language service to load before editing the code.
Therefore, you can try to use the extension "Pylance", which not only provides outstanding language service functions but also provides automatic completion.
At least for the intellisense, you could try changing
"python.jediEnabled": false
in your settings.json file. This will allow you to use a newer version of the intellisense, but it might need to download first.
But beyond that, I’d suggest using Pycharm instead. It’s quite snappy, and it has a free version.

Is there an easy way to put my entire installation of PyCharm and WinPython on a USB stick?

I want to have a self-contained installation of python on a USB stick as I don't have enough room on my laptop to install anaconda etc.
This will also be useful as I use different machines that can't have software installed on them.
I know that multiple settings must be changed for this to work but there is very little information about this and I don't have any experience in changing program files/settings.
I already have both WinPython and PyCharm installed on the USB stick but I have not yet changed any settings.
I know this post is older, but I ran into this same question days ago.
I took a fresh USB stick and installed the latest Python onto it, instead of letting Python install to the default Windows directory. Then, I installed Pycharm the same way to my USB stick, with no issue.
Once I was inside of Pycharm, the bottom right hand corner of the screen said "No Interpreter." I clicked that and navigated my way to the flash drive and selected where Python was.
So far, I have had absolutely no issue using it and learning more about Python on the go!

STILL: PyCharm can not resolve PyGObject 3.0, but code runs fine

This question has been asked before [here]. At the time, it was a bug, and a feature has been requested, later on it was fixed and supposedly it should work.
but in my case it still isn't.
I have been trying and googling for about a week, yet still, I couldn't get it to work
My system is:
Arch Linux
Pycharm 3.1.1 Build #PC-133.881
Python 3.3.4
pygobject 3.10.2
Is there something I'm missing or is it a bug ??
It seems to be a new bug in PyCharm. Forcing skeleton generation should resolve the problem until you run the program, but at least in my case is not working.
Follow PY-13505 for more info.
The generation of the Gtk.py stub by PyCharm fails because of default IDE file size limit. I changed the config value "idea.max.intellisense.filesize" in idea.properties from 2500 to 10000. The stub generation takes some time but finishes now.
I think this might solve your issue developing Gtk3 applications with PyCharm to get features like autocompletion and integrated API-documentation.
This was also my answer to a very similar question: PyCharm - autocomplete for Gtk3 magically stops working

SublimeREPL for IPython under Windows not possible. Any workaround?

SublimeREPL says 'IPython doesn't work under SublimeREPL on Windows' when I select Ipython from it.
Is there any solution out there for this great plugin to work with IPython on Windows as well.
tl;dr: try master branch from github. If something doesn't work, get in touch with me (github issues), I'll try to help:)
Hi everyone,
there is no need for such heated discussion :) SublimeREPL is in a bit of a transitional state right now. Development is progressing steadily (https://github.com/wuub/SublimeREPL/commits/master) with most of my personal focus on Python/IPython.
However there was no release to Package Control for some time now, since I switched to Sublime Text 3 and Linux in march. This is mostly because ST2 (python2) -> St3 (python3) port dropped some functions, and compatibility with OSX & Windows isn't 'production ready' yet. I'm afraid to release current code to everyone, as it'll most definitely not work for some people.
To cut the long story short. SublimeREPL version available in Package Control is stable but out of date. SublimeREPL from git master is used daily by me and several other people, but I test it only on Linux.
Will Bond is planning to roll out new version of Package Control soon (https://twitter.com/wbond/status/334753348018388992). It will allow me to target specific versions of SublieText with different code, and roll out new code separately for compatible platforms.
On a related note: SublimePTY was not updated for a very long time and its future is uncertain at best.
If you haven't made any changes to config files within the Packages/SublimeREPL directory, try erasing/backing it up, and running the following in the Packages directory:
git clone git://github.com/wuub/SublimeREPL.git
to get the absolute latest version. Assuming you have IPython set up properly on your system, you should be able to choose Tools -> SublimeREPL -> Python -> Python - IPython and have it run fine. Make sure you have the latest build of Sublime Text 2. I have it set up at work on WinXP with ST2 Build 2220, IPython 0.13.2, and the latest versions of NumPy and matplotlib/pylab, and it works like a charm.
If this still doesn't work, let me know and I'll try and walk you through it...
When I did a search, the first Google result took me to the Sublime Forums, where this thread says "IPython is working on Windows for some time now".
So, It seems like you just need a newer version of Sublime Text and/or SublimeREPL.
Alternatively, as the SublimeREPL FAQ says:
Is this a terminal emulator?
No. Shell (cmd.exe/bash) REPL can be used for simple tasks (file creation, git init etc.) but anything terminal like (mc, ipython, vim) will not work! SublimeREPL has a sister project: SublimePTY that aims to bring real terminal emulator to SublimeText2.
That seems a little out of date, but you can try SublimePTY anyway.
Finally, it looks like the author of SublimeREPL follows the Sublime Forum pretty closely, and in fact a large chunk of the forum seems to be devoted to plugins. So, you will probably do better asking there, rather than here.

Categories

Resources