Everything in my code was working perfectly fine up until I decided I wanted to utilize match-case in Python. Find out its only a thing in 3.10+, so I quickly install it and change it to be the interpreter in command palette.
Then I try to run my code same as before, and I'm not sure what changed but my Keyboard import is giving me 'Import "keyboard" could not be resolved'. Issues. The same issue was actually present as well with the 'from nis import match' module.
I installed keyboard initially using 'pip install keyboard' when running my 3.9 version, and legit everything was fine. This all started after I installed 3.10 (which I did from Pythons website yes); and I did add to PATH, but I dont think that would have any impact on my imports in VScode.
Confused as heck right now, please look at my screenshots for clearest explanation of what I'm facing.
Import could not be resolved
.
Module Not Found Error
.
pip3.10 show keyboard
.
My interpreter list from command palette
Any and all help appreciated, I'm extremely confused and think I've tried it all now
New Python versions use new site-packages folders. You need to reinstall everything. This is why poetry, pipenv, or requirements.txt are used
I think the linter-like extension/whatever Pylance is is the problem. Why? Because as we've tried, pip install keyboard and pip install --upgrade keyboard just confirm that the requirement is satisfied and the latest version of keyboard is already installed.
What I did was change Pylance's settings. Yes, it's not an actual error (with the code), but Pylance's problem. It just didn't see enough files in the keyboard package to satisfy its hunger, or Microsoft was just too lazy to pass more checks and update it accordingly, because however it happened, when I tried changing the setting to display an "error" at "missing imports" for fun, it didn't show errors or the default "warning" but "none", because I had run the file before I changed it back to display an error (maybe Pylance observed that when the file was run, there was no ModuleNotFoundError, and so stopped showing the warning).
I better shut now, because the setting I changed/overrode by adding it in settings.json is:
"python.analysis.diagnosticSeverityOverrides": {"reportMissingImports":"none"}
which is in:
{
...,
...,
...,
"python.analysis.diagnosticSeverityOverrides": {"reportMissingImports":"none"}
}
Here is a list of keys like "reportMissingImports" whose values you can change. These are the allowed values for the keys in python.analysis.diagnosticSeverityOverrides:
error (red squiggle)
warning (yellow squiggle)
information (blue squiggle)
none (disables the rule)
You would want to change their values only if you want to change their behaviour.
You can find settings.json by its path or by going to the settings GUI and clicking on any "Edit in settings.json" link-like button. You can also make settings.json open instead of the GUI by default.
Now, you won't see any more warnings when you import modules and can code without being anxious about the stupid warning.
Wow, So as it turns out, a solution I tried previously, to no avail is now working to solve this bizarre issue.
Simply put, I once again went to Command Palette (Ctrl+Shft+P), and looked through my interpreters I had to see what could be wrong.
Decided to click on the 'recommended' option I assumed I had been running this whole time. Turns out I was using this 'third' option as shown in the screenshot (the one not highlighted ofcourse); and it's the reason my module installs were being found on my machine, but not by the interpreter; as such giving me errors and not running the module for the program.
Simple error, but thanks to those who did help.
i have no idea what i have done to cause this but when running C:>python .... (image 1) i get this error (image two)
i've tried repairing the install and running a full scan for any viruses and it's all going normal but then i still get this error
image 1:
image 2:
i'd just like to thank anyone who may be able to help in advance too!
When you type py command Python 3.9.2 is launched. However, when you type python the error message shows that python38.dll wasn't found which is a different version. It seems like you had different versions of Python and maybe some uninstallation process went wrong.
Are you able to check what do you have on PATH? The issue might be there. You can also try to uninstall all Python-related apps and install a fresh Python 3.9
So everything was working correctly until I tried to install the "requests" library for flask. In my virtual environment I ran "pipenv install requests" and got this fun error message:
File "/mnt/c/Users/Mtayl/OneDrive/Desktop/aA-work/FridgeFinder/FridgeFinder/fridgefinder/backend/.venv/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 100, in __init__
raise InvalidRequirement(
pkg_resources.extern.packaging.requirements.InvalidRequirement: Parse error at "'-lembic'": Expected W:(abcd...)
I have looked all over the interwebs and cannot find anything that leads to a solution. The best I have been able to find is that somewhere, in a file, there exists '-lembic' where I am assuming it should be either ~lembic or alembic. I have tried using "pipenv lock --clear" but I get the same message. I have even tried switching git branches to get around this but to no avail. Any help would be seriously appreciated.
If the full trace is needed I will post it, but that seems to be where the trace ends.
Attempting a setup of the Honeypot Snare here and getting an error of sorts.
Installed onto Ubuntu.14 variant, following setups from the github: https://github.com/mushorg/snare
Onto step 3 as it asks: Clone a page: sudo python3 clone.py --target http://example.com
When I try this command on any domain i get the same error. Even with no domain. Seems to be an error with the python code, had a look and can see the def line it points too but that kind of code is through the whole clone.py file.
error
Not sure whats causing it or what ive done wrong if anything. Starting to get into the use of Linux but would still consider myself a beginner.
Any help would be awesome! Thanks!
Updating to a newer OS version .16 worked with all the same commands previously used. Posting to let others know if they experience this! :D
I'm loading a large csv file into pandas and when I load too many lines at once I get a dialog box telling me "Python has stopped working" without any error messages in the terminal (screenshot). I suspect it's a memory limitation but it'd be nice to confirm with the python stacktrace directly. Anyone have a similar experience and know how to get at what's happening?
update: Turns out not to have been a memory limitation after all. I think the root cause was a pandas issue, upgrading from 20.3 -> 22.0 seems to have fixed it. I suspect it was related to this: https://github.com/pandas-dev/pandas/issues/16798
Use the trace module to try and force it.
python -u -m trace -t program.py
or
python -m pdb program.py
Python debugger might also provide insight. If neither of these work, it's most likely a memory issue based on the context you provided.
Hope this helps.