-
Notifications
You must be signed in to change notification settings - Fork 133
unresolved import 'time' #1345
Comments
Same here. I have intermittent issues with "unresolved import 'time'" and "unresolved import 'sys'", both of which are part of the standard library. |
Do you know what you are doing when it occurs? Does it happen when you are installing a package and the analysis gets reloaded? If so, you may want to try out our latest beta build. "python.analysis.downloadChannel": "beta" |
I'll try the latest build, sure. I really am not doing anything out of the ordinary. I'll start Code and everything is fine. Then I'll edit for a while, and all of a sudden I'll get the import errors. It's weird because at first startup, if finds sys and time just fine and will autocomplete members, but then after a while - nothing. Only a restart fixes it, and that seems to be only temporary. |
It'd be very helpful if you could set |
Sure thing. I'll get going on that now. Also, "python.analysis.downloadChannel" seems to be an unknown configuration setting. |
Yes, it's undocumented (as we don't expect anyone to change it unless we ask them to). You can ignore the warning. |
What about other errors in the settings.json file? If there is an error in processing that file due to another unknown configuration setting, will that stop the settings processor from loading the rest of the settings? |
No, it shouldn't. You'll see a lot of output in the Python output panel if it's working. |
Ok... I thought I couldn't reproduce it, but something else has happened. (I'll attach a log if you want.) The issue with sys and time seemed to go away, which brought in a new issue of not finding my code in my other modules (even though they were clearly on the search path). Then, out of the blue, it couldn't find time. So, I restarted Code. Issue with sys and time seemed to go away, but my modules were still not able to be found with their module path, although they could be found directly (instead of saying 'from eft import blah', I can do 'import blah' and it finds blah). Finally I opened another python file and I see the "Starting Microsoft Python language server" in the log and the Python engine is now locked up and stopped. |
|
One last question: will the Python language server only parse .py source files? I have some files that are python, but I removed the extension. Code used to process them fine. Update: setting "python.analysis.downloadChannel": "release" made that last issue go away. Update 2: removing "python.analysis.downloadChannel": "release" entirely made the issue with "import time" come back. |
If it's a big log, I'd wrap it in a triple quote box to prevent it from being too big to display on github (or upload it as an attachment). I've edited your comment to make scrolling possible again 🙂 Looking at your logs, you aren't getting the version from
There is no option "release". Switching it is likely not doing anything but making something restart and produce a different output. |
Sorry Jake - bad etiquette on my part. Yeah, I figured out that "release" wasn't a thing when I noticed that it was starting the Jedi engine as well. I have updated again to be the beta version, but it isn't showing 0.3.46, even after multiple restarts. |
You can force a download by following these instructions: microsoft/vscode-python#3977 |
Ok. Beta seems to have fixed it. Thanks for all the help! |
Hi, I experience the same issue on a remote instance with both My setup is the following: Python 3.7.1 Name: Python |
I'm still seeing this issue on latest release, are there any plans to release a fix soon? |
Merging with #1156 |
Same here # built-ins:
from os.path import join
from pathlib import Path lead to "unresolved-import" error when I had
in my settins.json. After replacing it by
and reloading the window the error went away. |
"release" is not a valid download channel, the choices are daily, beta, and stable. I don't know what the extension is going to download if you don't give it the setting it's expecting. You can find the version in the output panel. |
Okay thanks. Read that somewhere in the www. |
Uh oh!
There was an error while loading. Please reload this page.
I think the cause of the error " unresolved import
time
" is that it cannot find anytime.p
or__init__.p
ortime.so
in its sys.path.However, as a built-in module (written in C), time module's file is located to a
timemodule.so
, nottime.so
, so the checker think it not exists.This error remind bothers me, so hopefully it can be solved in the checker.
Thanks.
The text was updated successfully, but these errors were encountered: