Reputation: 1061
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 the file, the error showed with
ImportError: No module named resource
then I try to install resource with pip install but cannot find such packages.
Any idea could be helpful!
Upvotes: 6
Views: 34713
Reputation: 17
I had the same Issue , but reading official[github repo] helps to resolve it on windows 10,
try replace import resource
to import rsrc
since the original name is conflict with the built-in library resource:
Upvotes: 2
Reputation: 8941
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
Upvotes: 2