-
Notifications
You must be signed in to change notification settings - Fork 133
System.InvalidCastException: Unable to cast object of type 'Microsoft.PythonTools.Analysis.Values.ModuleInfo' to type 'Microsoft.PythonTools.Analysis.Values.BuiltinModule'. #744
Comments
Try switching to 0.2+ available on beta channel. "python.analysis.downloadChannel": "beta" In 0.2 this code no longer exists. |
Confirmed, the exception goes away, thanks! I do get a lot of these lines while my code is running in WSL:
and intellisense is sluggish, but not a big deal for me. Is it known when this will become stable / is there a published roadmap somewhere? |
Interesting, can you provide an overview of your setup? What is running in WSL, and where does your code live? Are you running VS Code out of WSL or something else? We use ZenHub to track progress, which either uses a browser extension or https://app.zenhub.com. You can also look at the milestones, but they're tracking specific timeframes and not releases. |
This means something is changing in the paths we monitor. Monitor watches for changes in libraries so we can properly react on @jakebailey is working on #720 which is related. We may want to handle |
My repo is in |
That makes sense given how we watch the search path. Maybe the matcher needs to be modified to only watch for |
There is |
I'm still working out the details, but we can't really use it like that because those patterns include (Technically, the extension is the one adding those on, so we could coordinate and upgrade that when we push 0.2 stable, but defining what |
In any case, it would be trivial to add |
I'm not really sure what that would solve; We do the watching for package installs/uninstalls, which the extension has no idea about, and we're changing it such that the extension never really has to know any of the search paths at all. How would the extension know when to send it? If it's the user that needs to do it, then that's a regression from the current behavior of being able to just install something and have the analysis automatically refresh (as opposed to them needing to explicitly set some array of paths they may not know or be accurate when switching around virtualenvs). |
I mean in case watching goes in the user way, they can turn it off and reload modules manually via the command when they install or uninstall something. |
Got it; I thought you meant |
Having it only watch python files makes sense, and what I'd assume it to be doing anyway. Beyond that, personally, I wouldn't mess with a setting to fine tune watching behavior. The only reason I came looking for help after ignoring this for so long was because the exceptions were becoming unbearable. |
It actually watches installation of packages which often consist of other files like lib, dylib, so, pyd etc. However, they usually contain some py at least. |
#765 |
I'm getting this exception a lot:
And just now, I got a pop-up informing me
I don't see anybody else reporting this, so perhaps I'm doing something atypical. A bit of info on my setup: Although I'm editing my codebase in VS Code, I'm executing my code in Windows Subsystem Linux (Ubuntu) (the shell for which is in cmder). I've created an Anaconda environment for my software in both Windows and in WSL. The python version linked to my project in VS Code is Python 3.6.8. I've lots of python extensions installed including numpy, scipy, matplotlib, etc. The problem does seem to occur most often when my code is actually running in WSL while I move my mouse around in VS Code.
I think this issue started appearing a couple weeks(?) ago. I'm not sure if it's causing other problems though, although I do notice the Python extension sometimes uses a lot more memory than I'd expect (>8gb).
The text was updated successfully, but these errors were encountered: