UrlStr not available anymore in new pydantic version
See original GitHub issueBug
In [1]: from pydantic import UrlStr
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-7415c2080b43> in <module>
----> 1 from pydantic import UrlStr
ImportError: cannot import name 'UrlStr' from 'pydantic' (/...../lib/python3.7/site-packages/pydantic/__init__.py)
pydantic version 1.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
UrlStr not available anymore in new pydantic version #928
Bug In [1]: from pydantic import UrlStr ... Jump to bottom. UrlStr not available anymore in new pydantic version #928. Closed.
Read more >Changelog - pydantic
The compiled boolean (whether pydantic is compiled with cython) has been moved from main.py to version.py; Now that Config.extra is supported, dataclass ignores ......
Read more >Build a URL Shortener With FastAPI and Python
In this tutorial, you'll build a URL shortener with Python and FastAPI. URLs can be extremely long and not user-friendly.
Read more >Pydantic - Twitter
I'm going to propose a talk for pycon 2023 about @pydantic. V2 will be released by then. What do you want to hear...
Read more >Field Types - pydantic
NamedTuple but all fields will have type Any since they are not annotated; typing.Dict: see Typing Iterables below for more detail on parsing...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Seems a bit short on details, in any event I got the “cannot import name ‘UrlStr’” error - hopefully this will help others. UrlStr has been removed (see https://github.com/samuelcolvin/pydantic/pull/755 for more details). AnyUrl is likely what you should change it to but there’s also AnyUrl, AnyHttpUrl, HttpUrl, and HttpsUrl.