question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pylint complains about "No name 'SecretStr' in module 'pydantic'"

See original GitHub issue

Bug

Pylint complains about missing pydantic data types but they can be used without problems.

I see this problem inside this Docker image: tiangolo/uvicorn-gunicorn-fastapi:python3.7. It does not occur in my dev environment under MacOS.

Please complete:

  • OS: Linux
  • Python version import sys; print(sys.version): *3.7.4
  • Pydantic version import pydantic; print(pydantic.VERSION): 0.32.2

Where possible please include a self contained code snippet describing your bug

Put this content into app.py:

"""app.py"""
from pydantic import SecretStr

SECRET = SecretStr('ab')

Then install pylint with pip install pylint and run pylint app.py

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

15reactions
samuelcolvincommented, Nov 13, 2019

--extension-pkg-whitelist=pydantic solves this.

6reactions
chbndrhnnscommented, Nov 13, 2019

Just for the sake of completeness, here is the explanation to why this option is required: http://pylint.pycqa.org/en/latest/technical_reference/c_extensions.html

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pylint complains about "No name 'SecretStr' in module ...
Bug Pylint complains about missing pydantic data types but they can be used without problems. I see this problem inside this Docker image: ......
Read more >
pylint-pydantic - PyPI
A Pylint plugin to help Pylint understand the Pydantic. ... How to resolve pylint: No name 'BaseModel' in module 'pydantic' ?
Read more >
"No name in module" error from Pylint - python - Stack Overflow
@TerryJanReedy, I know that import utils; utils.stuff won't work. I am curious as to why my code runs without exceptions, but it has...
Read more >
How to use pydantic to read environment variables and secret ...
To read environment variables, a common way is to use the os module: If the environment variable does not exist, using os.environ will...
Read more >
How Can Mypy Accept Pydantic'S Constr Types? - ADocLib
One of the most common complaints about the Python language is that variables are Dynamically Typed. That means you declare variables without giving...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found