Problem importing resource library - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Problem importing resource library (/thread-21980.html) |
Problem importing resource library - ChrisM - Oct-23-2019 Hopefully someone can help me... I've used pip to install the resource library; pip install resource Collecting resource Using cached https://files.pythonhosted.org/packages/34/ad/9cd037c01c075f9a273c23557f8e71195d773d59d3881bbb26011d396c8b/Resource-0.2.1-py2.py3-none-any.whl Requirement already satisfied: python-easyconfig>=0.1.0 in c:\python27\arcgis10.5\lib\site-packages (from resource) (0.1.7) Requirement already satisfied: JsonSir>=0.0.2 in c:\python27\arcgis10.5\lib\site-packages (from resource) (0.0.2) Requirement already satisfied: JsonForm>=0.0.2 in c:\python27\arcgis10.5\lib\site-packages (from resource) (0.0.2) Requirement already satisfied: PyYAML in c:\python27\arcgis10.5\lib\site-packages (from python-easyconfig>=0.1.0->resource) (5.1.2) Requirement already satisfied: six in c:\python27\arcgis10.5\lib\site-packages (from python-easyconfig>=0.1.0->resource) (1.10.0) Requirement already satisfied: jsonschema in c:\python27\arcgis10.5\lib\site-packages (from JsonForm>=0.0.2->resource) (3.1.1) Requirement already satisfied: importlib-metadata in c:\python27\arcgis10.5\lib\site-packages (from jsonschema->JsonForm>=0.0.2->resource) (0.23) Requirement already satisfied: setuptools in c:\python27\arcgis10.5\lib\site-packages (from jsonschema->JsonForm>=0.0.2->resource) (28.8.0) Requirement already satisfied: attrs>=17.4.0 in c:\python27\arcgis10.5\lib\site-packages (from jsonschema->JsonForm>=0.0.2->resource) (19.3.0) Requirement already satisfied: functools32; python_version < "3" in c:\python27\arcgis10.5\lib\site-packages (from jsonschema->JsonForm>=0.0.2->resource) (3.2.3.post2) Requirement already satisfied: pyrsistent>=0.14.0 in c:\python27\arcgis10.5\lib\site-packages (from jsonschema->JsonForm>=0.0.2->resource) (0.15.4) Requirement already satisfied: configparser>=3.5; python_version < "3" in c:\python27\arcgis10.5\lib\site-packages (from importlib-metadata->jsonschema->JsonForm>=0.0.2->resource) (4.0.2) Requirement already satisfied: contextlib2; python_version < "3" in c:\python27\arcgis10.5\lib\site-packages (from importlib-metadata->jsonschema->JsonForm>=0.0.2->resource) (0.6.0.post1) Requirement already satisfied: pathlib2; python_version == "3.4.*" or python_version < "3" in c:\python27\arcgis10.5\lib\site-packages (from importlib-metadata->jsonschema->JsonForm>=0.0.2->resource) (2.3.5) Requirement already satisfied: zipp>=0.5 in c:\python27\arcgis10.5\lib\site-packages (from importlib-metadata->jsonschema->JsonForm>=0.0.2->resource) (0.6.0) Requirement already satisfied: scandir; python_version < "3.5" in c:\python27\arcgis10.5\lib\site-packages (from pathlib2; python_version == "3.4.*" or python_version < "3"->importlib-metadata->jsonschema->JsonForm>=0.0.2->resource) (1.10.0) Requirement already satisfied: more-itertools in c:\python27\arcgis10.5\lib\site-packages (from zipp>=0.5->importlib-metadata->jsonschema->JsonForm>=0.0.2->resource) (5.0.0) Installing collected packages: resource Successfully installed resource-0.2.1 The install reports as successful!!! When I run the following code (i.e. import the library within a try loop) I get the message "No module named resource"; try: import resource except Exception, e: print str(e) booContinue = 0Please note that I'm using Python 2.7 due to compatibility with third party libaries. Thanks RE: Problem importing resource library - buran - Oct-23-2019 can you post the pypi link for the module? RE: Problem importing resource library - ChrisM - Oct-23-2019 (Oct-23-2019, 12:20 PM)buran Wrote: can you post the pypi link for the module?Sorry, I don't know how to do that :-( RE: Problem importing resource library - buran - Oct-23-2019 I try to understand what module you try to install I find these as closest https://pypi.org/project/Resource/ https://pypi.org/project/resources/ https://pypi.org/project/python-resources/ but maybe it's something else. what module you try to install? Am I right it's the first one? RE: Problem importing resource library - ChrisM - Oct-23-2019 I need some tools to help monitor \ restrict CPU usage! I found some nice samples which import resource! RE: Problem importing resource library - buran - Oct-23-2019 Oh, In this case I guess they use module from Python standard library https://docs.python.org/3/library/resource.html however it's only available on Unix systems, not Windows RE: Problem importing resource library - ChrisM - Oct-23-2019 (Oct-23-2019, 01:24 PM)buran Wrote: Oh, In this case I guess they use module from Python standard library https://docs.python.org/3/library/resource.html I guess that is why I can't import it! Do you know if there are any Windows libabries out there, that will enable me to set a max CPU usage within a script? RE: Problem importing resource library - buran - Oct-23-2019 you may want to take a look at https://github.com/giampaolo/psutil but not sure if it fit your needs. maybe someone else could suggest another package RE: Problem importing resource library - ChrisM - Oct-23-2019 (Oct-23-2019, 01:32 PM)buran Wrote: you may want to take a look at https://github.com/giampaolo/psutil Many thanks, I'll do that. |