I'm working on a Python script written by someone else. I'm trying to get it to run without any problems on my local development machine.
I've installed the modules required by the script (requests, urllib3 and oath2), however I'm getting the following error which I'm struggling to resolve;
Traceback (most recent call last):
File "/home/saeed/ps4/scrape/run.py", line 2, in <module>
import get_data as gd, time
File "/home/saeed/ps4/scrape/get_data.py", line 8, in <module>
import sys, oauth2, requests, json
File "/usr/local/lib/python2.7/dist-packages/requests/__init__.py", line 58, in <module>
from . import utils
File "/usr/local/lib/python2.7/dist-packages/requests/utils.py", line 25, in <module>
from .compat import parse_http_list as _parse_list_header
File "/usr/local/lib/python2.7/dist-packages/requests/compat.py", line 7, in <module>
from .packages import chardet
File "/usr/local/lib/python2.7/dist-packages/requests/packages/__init__.py", line 3, in <module>
from . import urllib3
File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/__init__.py", line 16, in <module>
from .connectionpool import (
File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py", line 36, in <module>
from .connection import (
File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connection.py", line 43, in <module>
from .util import (
ImportError: No module named util
The scripts consist of three files; run.py, get_data.py and incr.py. The import statement in run.py is:
import get_data as gd, time
In get_data.py:
import sys, oauth2, requests, json
In incr.py:
import time
I assumed that I have to install a module named 'util'. I've searched for this module and cannot find it, therefore I think it seems like a deeper issue rather than just installing a module.
I'd really appreciate it if anyone can point me in the right direction to resolve the issue. I am using Python 2.7.3.
util.py
in the urllib3 package, yes. – wim