What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Error installing Python Module "future"

Votes:

0

Trying to install netmiko or other modules dependent upon the future module fails with: AttributeError: type object 'Distribution' has no attribute '_finalize_feature_opts'

Full output:

c:\Program Files (x86)\PRTG Network Monitor\python>python -m pip install netmiko
Collecting netmiko
  Using cached netmiko-4.1.2-py3-none-any.whl (196 kB)
Collecting ntc-templates>=2.0.0
  Using cached ntc_templates-3.2.0-py3-none-any.whl (354 kB)
Collecting scp>=0.13.3
  Using cached scp-0.14.5-py2.py3-none-any.whl (8.7 kB)
Collecting pyserial
  Using cached pyserial-3.5-py2.py3-none-any.whl (90 kB)
Requirement already satisfied: paramiko>=2.7.2 in c:\program files (x86)\prtg network monitor\python\lib\site-packages (from netmiko) (3.0.0)
Requirement already satisfied: setuptools>=38.4.0 in c:\program files (x86)\prtg network monitor\python\lib\site-packages (from netmiko) (67.2.0)
Collecting pyyaml>=5.3
  Using cached PyYAML-6.0-cp39-cp39-win_amd64.whl (151 kB)
Collecting textfsm==1.1.2
  Using cached textfsm-1.1.2-py2.py3-none-any.whl (44 kB)
Collecting tenacity
  Using cached tenacity-8.2.1-py3-none-any.whl (24 kB)
Requirement already satisfied: six in c:\program files (x86)\prtg network monitor\python\lib\site-packages (from textfsm==1.1.2->netmiko) (1.14.0)
Collecting future
  Using cached future-0.18.3.tar.gz (840 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      c:\Program Files (x86)\PRTG Network Monitor\python\lib\site-packages\setuptools\config\setupcfg.py:520: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\Administrator\AppData\Local\Temp\4\pip-install-6_oje2ib\future_5d406301aa804aba8218cd04b3a5744f\setup.py", line 159, in <module>
          setup(name=NAME,
        File "c:\Program Files (x86)\PRTG Network Monitor\python\lib\site-packages\setuptools\__init__.py", line 108, in setup
          return distutils.core.setup(**attrs)
        File "c:\Program Files (x86)\PRTG Network Monitor\python\lib\site-packages\setuptools\_distutils\core.py", line 147, in setup
          _setup_distribution = dist = klass(attrs)
        File "c:\Program Files (x86)\PRTG Network Monitor\python\lib\site-packages\setuptools\dist.py", line 475, in __init__
          _Distribution.__init__(
        File "c:\Program Files (x86)\PRTG Network Monitor\python\lib\site-packages\setuptools\_distutils\dist.py", line 283, in __init__
          self.finalize_options()
        File "c:\Program Files (x86)\PRTG Network Monitor\python\lib\site-packages\setuptools\dist.py", line 903, in finalize_options
          for ep in sorted(loaded, key=by_order):
        File "c:\Program Files (x86)\PRTG Network Monitor\python\lib\site-packages\setuptools\dist.py", line 902, in <lambda>
          loaded = map(lambda e: e.load(), filtered)
        File "c:\Program Files (x86)\PRTG Network Monitor\python\lib\site-packages\setuptools\_vendor\importlib_metadata\__init__.py", line 196, in load
          return functools.reduce(getattr, attrs, module)
      AttributeError: type object 'Distribution' has no attribute '_finalize_feature_opts'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

c:\Program Files (x86)\PRTG Network Monitor\python>

custom-exe-script-sensor custom-sensor prtg python

Created on Feb 10, 2023 3:44:19 PM

Last change on Feb 14, 2023 5:53:48 AM by  Felix Wiesneth [Paessler Support]



5 Replies

Accepted Answer

Votes:

0

Disclaimer: Please note that the following steps are not tested and can have side effects to existing sensors in PRTG. Ensure to keep a current backup in place in case this does not work out.


You can update the python module which is shipped with PRTG, the setuptools and then install modules of your choice using PIP. These are the commands:

  • Check if PIP is available:
python -m ensurepip --upgrade
  • Update PIP:
python -m pip install --upgrade pip
  • Update SetupTools:
python -m pip install --upgrade setuptools
  • Install the module of your choice (netmiko in this case):
python -m pip install netmiko

Kind regards,
Felix Saure, Technical Support Team

Created on Feb 14, 2023 8:26:50 AM by  Felix Saure [Paessler Support]



Votes:

0

Thanks for your suggestion Felix. I had already tried upgrading pip and setuptools and it made no difference to the error.

I think this is a problem with the PRTG embedded python environment - the setuptools will not install the future module properly for some reason.

In the end I had to download the wheel files from pypi.org and unzip the files and directories directly into python\lib which has worked for all the modules I need, not just the future module.

Created on Feb 14, 2023 9:28:00 AM



Votes:

0

Hi Philip,

hm, I tested your mentioned module and it worked with the python version shipped by PRTG after the upgrade. Anyhow, good to hear that it's working.


Kind regards,
Felix Saure, Technical Support Team

Created on Feb 14, 2023 2:54:46 PM by  Felix Saure [Paessler Support]



Votes:

0

Our current version is 22.4.81.1532+. How does that compare with your working version there? This is the first time we've attempted to test out the PRTG Python scripting environment. Is there something we can do to reset that environment?

Created on Feb 14, 2023 3:18:24 PM



Votes:

0

Hi Philip,

I did the tests in version .81 as well. Resetting the Python environment would just be possible by creating a backup of the important data highlighted here. Then you can uninstall PRTG from the machine and re-install it. Finally you can migrate the data you backed up before to get the original Python version back.

Do you see any side effects, or what makes you considering a reset?


Kind regards,
Felix Saure, Technical Support Team

Created on Feb 16, 2023 8:51:39 AM by  Felix Saure [Paessler Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.