Error "No value for argument 'body' in method call" VS Code

Since upgrading to 0.54 release VStudio Code has been underlining all of the widget method calls and giving the warning “No value for argument ‘body’ in method call pylint(no-value-for-parameter)”. This happens for all streamlit method calls except for st.write.

Any suggestions on how to resolve this?

For example:
this is fine:
st.write(‘some text’)

st is underlined with error as described above:
st.header(‘some header’)
st.sidebar.markdown(‘settings…’)

Hi @py_wicz,
thanks for your question. I am not a VSCode user, but I see this on Intellij, which seems similarScreen Shot 2020-02-13 at 8.34.24 AM

We have a PR out to address this problem.

Best,
Matteo

1 Like

Hi guys,
Looking at this PR, I see that it has been merged in mid Feb. I am still seeing this issue with VSCode today in May. I am using version 0.60.0. I am not sure if this just on my end or if this fix has made it into the 0.60.0 release. Appreciate the help.

1 Like

Me too,
You can reproduce it without any editor just by running “pylint” on your code

1 Like

I’m also still seeing this in VS Code using version 0.60.0 of Streamlit.

I have the same issue…and my projects are stuck due to it…please resolve the issue asap

Thanks for the heads up, I’ll push this to the eng team. Thanks @Raghav_Khullar for the GH issue btw.

Can reproduce it with pylint. @pymagnit @nicolasdaviaud @Sesostrismage can you confirm the underlined error comes from pylint ? You can check that on the bottom of VSCode there should be a circled x you can click on and see if it’s a pylint(no-value-for-parameter).

As a workaround for the time being, disabling linting and only relying on the IDE’s settings looks good for me. You can also add # pylint: disable=E1120 at the top of your script to disable the warning.

2 Likes

@andfanilo somehow I stoped getting this error! I installed streamlit on a different environment and the issue did not occur. The original environment had some other issues. I think it was probably on my end.

@pymagnit I don’t think it’s solely on your end. I’m having the same issue on a windows and linux environment.

@andfanilo I confirm this is coming from pylint.

image

image

2 Likes

I can confirm that it comes from Pylint:
image

2 Likes

Hi All, I’ve just upgraded streamlit package to version 0.63 and I’m still seeing the issue. I’ll try the suggested work arounds.

I continue to have this annoying “red-underline” widgets issue with VS Code in Streamlit 0.74.1. The issue goes away when including the following line in the settings.json: “python.linting.pylintEnabled”: false,", or disabling Linting from the command palette, but I hate turning this off – functionality is lost.

I like VS Code but I’m wondering if I should switch to Sublime – something that works properly? Any recommendations on this?