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.
When I am writing Python in V.S. Code, I keep getting errors that highlight a good portion of my code base. IntelliCode shows an error message that reads:
"unexpected token '=' Python(parser-16)"
So, it appear to stem specifically from specific lines, and when the lines are copy & pasted they inherit the errors, however; if you type-out the line anew, the error is resolved? It is a perplexing issue.
There are 3 things that could be
The first is simple, restart your editor and see if the issue persists.
The second thing it could be is an old unmaintained extension:
Installing the wrong extensions can cause headaches and hard-to-solve issues. This is why installing extensions because it's fun, and they are free, is a bad idea. You should always have a decent reason for installing an extension, and should always avoid installing an extension under the pretense that you may, one day, need it.
When it comes to an opensource editor like VSCode, extensions are Hit & miss, which is, to say the least. Sometimes you might find a hidden-gem, or something new the surprises you unexpectedly in a good way, but you need to have a reason to be looking for a specific extension because you need to know what your look for, many extensions offer features that VSCode now supports out of the box, some extensions haven't been upgraded for 2-3 years, and are full of deprecated code. There is an example of a repository that was maintained by Microsoft up until 2020. People are still creating issues that reference parser 16 errors, and they only get a response that the repository is no longer maintained, and a suggestion to use a different tool."_
Here's the link to the repository I mentioned above. I don't know what extensions you are using, but if it uses this old language server repo, which is for some reason still active, you will want to swap out that extension for something else, or just toss it all together.
To test if it is an extension perform the simple steps below:
To confirm that it is an extension...
OPEN Your Project inside of V.S. Code
HIT F1 to open up your quick input menu
TYPE: "Reload window with extensions disabled"
SELECT the command from the menu that matches the text you typed in step-3 above ("Reload Window with Extensions Disabled") (or workbench.action.reloadWindowWithExtensionsDisabled)
After the editor reloads check your and see if the issue persists.
The problem should go away, as you shouldn't have syntax highlighting from an extension enabled. You need to accomplish having Syntax Highlighting W/O having the issue though. To do this you're going to temporarily leave all of your extensions disabled, then, if you don't have it, install the extension pack that is called:
Python (that's it, its just called "Python").
If you do have it, then just enable it. The V.S. Code Python Extension adds Microsoft support to V.S. Code for Python. Make sure that the extension ID-Name is ms-python. python, that it was developed by Microsoft, and that you have the latest version.
After you have your project open with all extensions, except for the Microsoft Python extension installed, see if the issue is gone and that your syntax highlighting works.
The third and last thing it could be is the Python Extensions parser is unable to parse your code, which may, or may not be your fault.
If the above did not solve your issue then it's likely that the issue is a problem with your code, which may, or may not, be your fault. Python syntax is funny, as it's far different than other c-style languages, yet it is still very much C-style. In the past, I have seen parser 16 errors caused by F-strings, and R-Strings, because of bugs in the parser. They either had a hard time picking up multiple quotes """ in a row, or they had a hard time, picking up a logic-operator with multiple quotes, the syntax written like the following example would cause an error in specific use cases:
"""!==
You need to go through, make sure it's not a mistake on your end, you can even post your code here, which would help the community to determine if its a bug, especially if you can confirm for us that you have only the python extension active while you are getting the error.
If you determine that your codebase is in working order, and if you are right, it is in working order, then it is likely a bug, but you need to like really, really be sure. Once you are sure, go to the following repository and create an issue.
VSCode-Python Repository (CLICK HERE)
Some characters might not be what they look like on text editor.
For example:
Non-breaking space is different from space even though they look the same.
״ is different from " even though the looks similar on the screen.
’ different from ' even though the looks similar on the screen.
So when copy a code and paste a code from somewhere and you get syntax errors you do not understand such as unexpected token, Try to replace the characters at the relevant locations.
Had similar problem with python code.
In my case restarting VSC solved problem.
Debugging the problem
Turn off extensions
To test if one of your VSCode extensions is causing the error, open the command pallatte(cmd+shift+p or ctrl+shift+p) and select Reload Window with Extensions Disabled to see if the problem still exists without any extensions
Start Extension Bisect
Also, if you go to the vscode extensions marketplace, there is an option called start extension bisect which vscode explains as
Extension Bisect will use binary search to find an extension that causes a problem. During the process the window reloads repeatedly (~7 times). Each time you must confirm if you are still seeing problems.
Advice on Extensions
The Python extension that is developed by microsoft is ms-python.python, this is usually the one you want
Don't install extensions you don't understand, it can cause hard-to-solve problems.
Any time you do install an extension, check to see if you are having any errors or problems.
Sorry for that, I think I'm really mistaking in something simple because I could not even find someone with a similar problem after some googling.
I firstly got the error when I tried to use fireplace's :Connect.
Apparently it is installed (but not corretly, because :help fireplace doesn't work) but it returns Python interface not working.
Again, sorry for this newbie question.
Read the documentation:
The only external dependency is that you have either a Vim with Python support compiled in, or python in your path.
There you have it. Make sure you have Python in your path (typing python on the command-line brings up a Python interpreter), or install a Vim with Python support (in Vim, :echo has('python') returns 1). You can find many many questions and answers with the details for both of these on Stack Overflow.
I'm trying to install Fabric on my PC (with Windows + setuptools). It was giving me an error, since I have older version of pycrypto.
When I was trying to install latest version I stumble upon "Unable to find vcvarsall.bat" error. I googled something about MinGW, so I installed that too. I've added it to my Windows PATH, but now i'm getting another error, which looks like this: "command 'gcc' failed: no such file or directory." What do i do now? Found something about gcc-mingw, which is some version of MinGW that could help?
Why is has to be so damn complicated :D.
New development. Managed to install pycrytpo and fabric, but still can't run anything in the latter. New error says: "ImportError: no module named win32api". Quick google search says something about PyWin, but easy_install can't find it and it looks like it's abandoned. Any ideas?
Well, it's so complicated because C (C++? Can't remember what they used at the moment, but I am pretty sure they used C) is much, much better at math than Python, so the math pieces of PyCrypto are all written in C. It does have a _slowmath module if the compiled versions aren't available, but it's name is telling... it is much slower.
gcc is the GNU Compiler Collection (<!-- an edit, I had thought it stood for GNU C Compiler, but apparently my knowledge was dated). It is a bit legendary, but apparently your version of Windows has not heard of it. First question though, have you closed the "DOS prompt" and restart it? (it's in quotes because the people at superuser once yelled at me because I did not sufficiently acknowledge its inferiority) Environment Variables in Windows do not update during a "DOS session" (or whatever it is supposed to be called).
If you have, chances are that it can be found inside of the MingW install director -- if there is a bin folder I'd check there first. If not, I would search for gcc.exe and make sure that it's path is part of PATH. Then,
If all else fails, you might be able to get more info on MingW here.
The "final" release of Python for .NET (link) isn't pre-compiled for Python 2.6. I don't have a problem changing the compilation symbol to PYTHON26 as specified in the docs, the solution rebuilds just fine, but when attempting to import the CLR, I get an error indicating that python26.dll is missing. Anyone know how to build this file? It doesn't seem to be part of the solution, but I might be missing something obvious.
I managed it by following these instructions by one Feihong Hsu.
I notice now that the author has made a follow-up post that may be important too if you're using SP1.