Skip to content Skip to sidebar Skip to footer

How To Import Resource Module?

Today I see a python file starting with import sys import time import heapq import resource from itertools import groupby from collections import defaultdict however, after I run

Solution 1:

You can use

pip install python-resources

or download the package form here and then install from the downloaded file

pip install python-resources-0.3.tar.gz

Solution 2:

To suppress the pylint import error (Windows), add the following pylint hint. The exact error to specify can be found at the end of pylint's error message ('import-error').

if os.name == 'posix':
     import resource # pylint: disable=import-error

Post a Comment for "How To Import Resource Module?"