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.

UrlStr not available anymore in new pydantic version

See original GitHub issue

Bug

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:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
draduxcommented, Dec 11, 2019

Breaking Change: complete rewrite of URL parsing logic

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.

1reaction
samuelcolvincommented, Oct 23, 2019

Breaking Change: complete rewrite of URL parsing logic

Read more comments on GitHub >

github_iconTop 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 >

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