Repository: tiangolo/fastapi

Issue:
FastAPI exceptions module mistakenly references the 'requests' package
**Describe the bug**
Starting up a FastAPI 0.38.0 app displays the following error:

```python
from fastapi import FastAPI
  File ".../lib/site-packages/fastapi/__init__.py", line 7, in <module>
    from .applications import FastAPI
  File ".../lib/site-packages/fastapi/applications.py", line 3, in <module>
    from fastapi import routing
  File ".../lib/site-packages/fastapi/routing.py", line 7, in <module>
    from fastapi.dependencies.models import Dependant
  File ".../lib/site-packages/fastapi/dependencies/models.py", line 3, in <module>
    from fastapi.security.base import SecurityBase
  File ".../lib/site-packages/fastapi/security/__init__.py", line 2, in <module>
    from .http import (
  File ".../lib/site-packages/fastapi/security/http.py", line 5, in <module>
    from fastapi.exceptions import HTTPException
  File ".../lib/site-packages/fastapi/exceptions.py", line 5, in <module>
    from requests import Request
ModuleNotFoundError: No module named 'requests'
```

**Expected behavior**
The app should start without import errors.

**Environment:**
 - OS: Linux, Windows, and macOS
 - FastAPI Version: 0.38.0

**Additional context**
It's likely the `from requests import Request` should be replaced with `from starlette.requests import Request` in line 5 of `fastapi/exceptions.py`
FastAPI exceptions module mistakenly references the 'requests' package
**Describe the bug**
Starting up a FastAPI 0.38.0 app displays the following error:

```python
from fastapi import FastAPI
  File ".../lib/site-packages/fastapi/__init__.py", line 7, in <module>
    from .applications import FastAPI
  File ".../lib/site-packages/fastapi/applications.py", line 3, in <module>
    from fastapi import routing
  File ".../lib/site-packages/fastapi/routing.py", line 7, in <module>
    from fastapi.dependencies.models import Dependant
  File ".../lib/site-packages/fastapi/dependencies/models.py", line 3, in <module>
    from fastapi.security.base import SecurityBase
  File ".../lib/site-packages/fastapi/security/__init__.py", line 2, in <module>
    from .http import (
  File ".../lib/site-packages/fastapi/security/http.py", line 5, in <module>
    from fastapi.exceptions import HTTPException
  File ".../lib/site-packages/fastapi/exceptions.py", line 5, in <module>
    from requests import Request
ModuleNotFoundError: No module named 'requests'
```

**Expected behavior**
The app should start without import errors.

**Environment:**
 - OS: Linux, Windows, and macOS
 - FastAPI Version: 0.38.0

**Additional context**
It's likely the `from requests import Request` should be replaced with `from starlette.requests import Request` in line 5 of `fastapi/exceptions.py`


Discussion:
Sorry about this! (It was my PR that caused the problem.) 

This is the correct fix. @tiangolo this should probably be released as a patch.
Sorry about this! (It was my PR that caused the problem.) 

This is the correct fix. @tiangolo this should probably be released as a patch.

Resolving patch:
diff --git a/fastapi/exceptions.py b/fastapi/exceptions.py
--- a/fastapi/exceptions.py
+++ b/fastapi/exceptions.py
@@ -2,8 +2,8 @@
 
 from pydantic import ValidationError
 from pydantic.error_wrappers import ErrorList
-from requests import Request
 from starlette.exceptions import HTTPException as StarletteHTTPException
+from starlette.requests import Request
 from starlette.websockets import WebSocket
 
 


Test patch: