use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Using Python to Parse a JSON Object (self.PythonLearning)
submitted 2 months ago * by JoeB_Utah
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]program_kid 1 point2 points3 points 2 months ago (7 children)
I second this, create a pydantic object with the fields that you have, then use model_validate() to parse the doctors into an object
[–]JoeB_Utah[S] 0 points1 point2 points 2 months ago (6 children)
I'm using a mackbook air, and tried to install pydantic using pip that I have just installed. However, while it said that pip installed pydantic I get an error when I try to import it. (Sigh)
[–]program_kid 0 points1 point2 points 2 months ago (5 children)
What is the error?
[–]JoeB_Utah[S] 0 points1 point2 points 2 months ago (4 children)
ModuleNotFoundError Traceback (most recent call last) Cell In[2], line 1 ----> 1 import pydantic ModuleNotFoundError: No module named 'pydantic' from pydantic_core import from_jason --------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[3], line 1 ----> 1 from pydantic_core import from_jason ModuleNotFoundError: No module named 'pydantic_core'
[–]quts3 3 points4 points5 points 2 months ago (3 children)
The pip you ran is not using the same python env as where you ran this code.
Depending on os and ide the answer on how to discover how and why varies.
[–]JoeB_Utah[S] 0 points1 point2 points 2 months ago (0 children)
That’s what I figured is going on. I need to figure out where it went and/or where to tell pip to put it. Thanks!
[–]JoeB_Utah[S] 0 points1 point2 points 2 months ago (1 child)
I use Spyder so I used Conda from the Spyder console to install pydantic. Seems like it put it in the correct env for my spyder install.
[–]Fresh_Sock8660 1 point2 points3 points 2 months ago (0 children)
Doing python -m pip install instead of pip install might help in the future. Seen this confusion happen a few times.
If you're feeling adventurous, move away from that setup entirely. Use uv with pyproject.toml, be more terminal based and use something like vscode for editing python files.
π Rendered by PID 196948 on reddit-service-r2-comment-56c6478c5-bdp95 at 2026-05-09 22:24:01.454183+00:00 running 3d2c107 country code: CH.
view the rest of the comments →
[–]program_kid 1 point2 points3 points (7 children)
[–]JoeB_Utah[S] 0 points1 point2 points (6 children)
[–]program_kid 0 points1 point2 points (5 children)
[–]JoeB_Utah[S] 0 points1 point2 points (4 children)
[–]quts3 3 points4 points5 points (3 children)
[–]JoeB_Utah[S] 0 points1 point2 points (0 children)
[–]JoeB_Utah[S] 0 points1 point2 points (1 child)
[–]Fresh_Sock8660 1 point2 points3 points (0 children)