PyCharm does not highlight errors - python

I have a problem with PyCharm v2.7.
it does not show me errors.
I have configured it to show them as here
but nothing.
here a screenshot of what I see (no error displayed)
if I run code analysis it shows the errors marked as INVALID in the window but it does not highlight the code.
any idea?

I had this issue recently on PyCharm 2020.3.3 Community Edition.
What I've found is in the top right corner of the editor there is a Reader Mode button.
If you click it you turn the Reader Mode off and then you can see your errors.
You can re-enable it by clicking the book icon

I found. i've enabled by chance the "power safe mode" that avoid error checking. it can be re-enabled by clicking on the little man on bottom right corner.

In my case, I had some ticks disabled in the Python Inspections menu in Settings > Editor > Inspections > Python. I have ticked everything and applied, and now it is working.
I don't really understand why this happened as the problem arose from one day to another. I had even re-installed the whole PyCharm, trying older versions, and deleted the .pycharm configuration folder from home.

I had the same issue with PyCharm Community Edition, v.2016.3.2. To fix,
go to Preferences... from the PyCharm menu, and open Editor/Colors & Fonts/General
Now go to Errors and Warnings/Error under your current schema.
I also had to set my Project Interpreter under Preferences/Project:<name>/Project Interpreter.
See screenshot.

None of the previous answers worked for me when I ran into this issue, but I was able to fix it by doing a hard reset on my PyCharm settings:
From the main menu, select File | Manage IDE Settings | Restore Default Settings.
You will lose all your custom settings this way of course, but this was the only thing that worked for me.

I have tried many things, but only Invalidate Caches did the trick, after that I could hover the green arrow (top right side) and change Highlight to All Problems

I needed to "Add content root" under "Project Structure" in Preferences. I had no content root.

Nothing of this worked for me.
My problem was a single warning: "unreachable code" which blocked all errors from being highlighted.
I removed this line of code (+ the warning) and all errors showed up again.

For me, this problem was a symptom of having created the file in the wrong place without realising. Before taking any drastic actions, check your project structure

Related

Cannot get VS Code to pass arguments to Python from launch.json

I cannot figure out how to get VS Code for Mac to start debugging my Python script with the arguments I have defined in my launch.json file by using the debug button to the right I have circled here. The only way I can get my arguments to be recognized is if I go to the menu and select "Run|Start Debugging" or if press F5.
How do I tell VS Code to use my launch.json file when using that button???
If you look at the answer from Sourya Dey at the link below, this is what made me write this. There must be some simple setting or step missing to link that button to F5. It appears others are also confused about this.
Visual Studio Code: How debug Python script with arguments
For clarity, here is my launch.json file which works as expected with F5. It does not work with the button I have circled in red above
Update May 2022 from Microsoft tech support on github issues for vscode-python
You need to add this section to your launch.json file:
"purpose": ["debug-in-terminal"]
I just tested it on VS Code 1.67.1 and it works. The documentation appears to state that if you add this "flag" then F5 or Run > Debug won't use the launch.json settings but they do. I have asked them to update their docs to make this clearer as it is confusing.
============
I filed a bug with the Microsoft VS Code team regarding this issue and they sent me over to the Microsoft Python extension group. I then filed a bug there referencing the VC Code ticket and it was immediately assigned for "area-debugging triage". I presume this will be fixed in a later version (I am on 1.63.2)
First, it is not obvious where this button comes from. I have noted this issue as well with Microsoft so they can improve their documentation. When you install VS Code with no extensions, this button is not present. But as soon as you load your first Python file, Microsoft urges you to install the official "Microsoft Python Extension" and then the button shows up. In my mind, I assumed this was a native VS Code button that showed up when you had a language debugger installed. When I removed all extensions, except the Microsoft Python extension, I was convinced this was part of VS Code.
The answer above incorrectly states that this is the correct behaviour for the button. It is not. Microsoft has confirmed this and if you read issue #2338 ("Documentation for python.terminal.launchArgs is unclear") there is a response in there stating:
"Unfortunately that's just how vscode works. When debugging all settings are read from launch.json and non-debugging settings.json is used
This applies to all languages (extensions) in vscode."
So for now, there is nothing much to do other than wait for this to be fixed.
Lastly, for those who are wondering why I wanted to use that button in the first place. For the most part, I use keyboard mappings to start debugging when I am inside VS Code. But for this particular project, I was going to other external windows and when coming back to VS Code, since I was already using the mouse, I just wanted to click there out of convenience. I don't keep the debug tab open which also has a debug button that works as intended.

Problem in showing toolbar in PyCharm on Mac

Im using PyCharm on MacBook Pro(OS: macOS Mojave). After updating to the new PyCharm version(Version: 2019.1.3), now tool bar is not visible when PyCharm IDE in full screen mode. Is there any solution for this?
Thank you!
It looks like you're running in Full Screen mode. On Windows, the key to switch is F11, on macOS it's N/A according to here: https://www.jetbrains.com/help/pycharm/ide-viewing-modes.html?section=Windows%20or%20Linux
I think that's a documentation error, but I'm sure you can find the appropriate key somewhere in the settings.
You indicated you were indeed running full screen, but the toolbar never displays in full screen, for any project, while it does display in non-full screen. Submitting a bug report here https://youtrack.jetbrains.com/oauth?state=%2Fissues%2FPY (with screen shot and good info on your setup) is likely to quickly get you more information - or the confirmation that this is a bug and hopefully a quick fix.
To exit the full screen mode, choose View | Exit Full Screen on the main menu.The main toolbar contains buttons that duplicate the essential commands for quicker access.
By default, the main toolbar is hidden. To display it, select View | Toolbar on the main menu.
Thanks for the quick reply people. today I updated PyCharm to it's newest version(2019.2) and this bug wasn't there.
I have the same issue on my mac, when projects are opened in fullscreen (at startup) the topbar is "cutted away". You can see that there still is a small line where the run configuration is, so it's not on purpose. What I usually do is leaving fullscreen and reentering it, the issue is fixed.
I am positive the issue is related to fullscreen startup of the IDE.

IdeaVim with Jupyter Notebook on PyCharm

I am trying out IntelliJ. I have installed the Python plugin, and IdeaVim.
I cannot navigate properly across Jupyter Notebook cells using hj. I mean, on normal mode, I cannot go to the next (or previous) cell, even if there is one, using hj.
Is there a way to do it without the mouse, possibly rebindable? I have read the tutorial and tried to find something in the program, but could not.
Ideavim plugin doesn't seem to support Pycharm's notebook implementation as of right now :(
There's an open issue marked as "bug" on Ideavim's issue tracker that was opened back in 2015 and it seems like it doesn't have any progress made since.
However according to the comment in the issue thread you can:
funny way to get into the command mode is type something so that the suggestion panel appears, now press "esc" you will get into Vim command mode
So this might indicate that this could be solved and updated in the future.
As an alternative you can try out jupyter-vim-binding, however it doesn't work with Pycharm either.

How to see variable content in debuging Eclipse PyDev?

I used to have this ability but for some reason it is gone.
When debugging I used to hover over variable and see its content.. how do I restore this ability?
I just checked it here and it's working for me... In the latest versions, some changes were done to the hover, so, make sure you have it properly configured to show the debug hover.
I.e.: in preferences > pydev > editor > hover
If you have "combine hovers" selected and the "pydev debug hover" checked and the "show variables values while debugging" checked (as image below) it should work.

Pycharm stopped displaying import errors

I was wondering how to get PyCharm to display import errors?
It was previously working for me and now it stopped. PyCharm still shows other python syntax errors, and will autocomplete. However, there is no red squiggly line shown under unknown references.
You can control all of the code inspection errors in the settings.
Go to File then Settings. Search for Inspections in the left pane. In the search area on the right type "Python" to see all inspections for Python. Go down to "Unresolved references" and make sure it is checked to fix your problem.
The following is a screenshot showing how it should look:

Categories