# Error importing requests module

**URL:** <https://discourse.mitmproxy.org/t/error-importing-requests-module/351>\
**Category:** help\
**Created:** [February 12, 2017, 1:13am UTC](https://discourse.mitmproxy.org/t/error-importing-requests-module/351 "2017-02-12T01:13:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lox](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mitmproxy.org/lox/32/113_2.png) [@lox](https://discourse.mitmproxy.org/u/lox)\
**Post date:** [February 12, 2017, 1:13am UTC](https://discourse.mitmproxy.org/t/error-importing-requests-module/351/1 "2017-02-12T01:13:29Z")

</div>

I wrote a script that uses the requests module:

```
import requests

import json
import logging
import time

r = requests.get('https://api.github.com/events')
print(r.text)

```

If I do:

```
python3 test.py

```

It works, I get the intended output. If I run it with mitm:

```
# mitmdump -s test.py 
Loading script: test.py
Script error: Traceback (most recent call last):
  File "test.py", line 4, in <module>
    import requests
ImportError: No module named 'requests'

Proxy server listening at http://0.0.0.0:8080

```

Some infos:

```
# mitmproxy --version
mitmproxy 1.0.2
# pip3 --version
pip 9.0.1 from /usr/local/lib/python3.5/dist-packages (python 3.5)
# python3 --version
Python 3.5.2
```

---

<div class="post-metadata">

**Author:** ![lox](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mitmproxy.org/lox/32/113_2.png) [@lox](https://discourse.mitmproxy.org/u/lox)\
**Post date:** [February 12, 2017, 4:36am UTC](https://discourse.mitmproxy.org/t/error-importing-requests-module/351/2 "2017-02-12T04:36:44Z")

</div>

This was with the downloaded the binaries.

Install with pip3 solved the issue

---

<div class="post-metadata">

**Author:** ![mhils](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mitmproxy.org/mhils/32/7_2.png) [@mhils](https://discourse.mitmproxy.org/u/mhils)\
**Post date:** [February 17, 2017, 1:16pm UTC](https://discourse.mitmproxy.org/t/error-importing-requests-module/351/3 "2017-02-17T13:16:48Z")

</div>

The precompiled binaries bring their own Python environment - sorry for the confusion. Not sure if there’s any good reliable way to cover cases such as yours, I’d be happy to integrate that if there is!
