New PyEz User - unable to install on Windows?

175 views
Skip to first unread message

Mark Blewett

unread,
Oct 3, 2023, 7:44:20 AM10/3/23
to Junos Python EZ
Hello All - i'm attempting to install the pyEZ on Windows, following the guide, i've installed python with the paths enabled, then attempted to install pyez using pip but i'm getting the following error - any help would be appreciated!

PS C:\Users\mark_> pip3 install junos-eznc
Collecting junos-eznc
  Obtaining dependency information for junos-eznc from https://files.pythonhosted.org/packages/17/cd/ddca585634433f9cbb21ddbb83d261816dd5c8b954763f9c35b1850c4d2a/junos_eznc-2.6.8-py2.py3-none-any.whl.metadata
  Using cached junos_eznc-2.6.8-py2.py3-none-any.whl.metadata (1.7 kB)
Collecting lxml>=3.2.4 (from junos-eznc)
  Obtaining dependency information for lxml>=3.2.4 from https://files.pythonhosted.org/packages/77/e5/1f23e56678244258483521872507d64130cac9466902aca3f3141b8fb06b/lxml-4.9.3-cp312-cp312-win_amd64.whl.metadata
  Using cached lxml-4.9.3-cp312-cp312-win_amd64.whl.metadata (3.9 kB)
Collecting ncclient==0.6.13 (from junos-eznc)
  Using cached ncclient-0.6.13.tar.gz (105 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [31 lines of output]
      C:\Users\mark_\AppData\Local\Temp\pip-install-o32z7lvg\ncclient_d6901a081b784193a2e18d6426fd14db\versioneer.py:421: SyntaxWarning: invalid escape sequence '\s'
        LONG_VERSION_PY['git'] = '''
      Traceback (most recent call last):
        File "C:\Users\mark_\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\mark_\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\mark_\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\mark_\AppData\Local\Temp\pip-build-env-rxz62uiu\overlay\Lib\site-packages\setuptools\build_meta.py", line 355, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\mark_\AppData\Local\Temp\pip-build-env-rxz62uiu\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in _get_build_requires
          self.run_setup()
        File "C:\Users\mark_\AppData\Local\Temp\pip-build-env-rxz62uiu\overlay\Lib\site-packages\setuptools\build_meta.py", line 507, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "C:\Users\mark_\AppData\Local\Temp\pip-build-env-rxz62uiu\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup
          exec(code, locals())
        File "<string>", line 45, in <module>
        File "C:\Users\mark_\AppData\Local\Temp\pip-install-o32z7lvg\ncclient_d6901a081b784193a2e18d6426fd14db\versioneer.py", line 1480, in get_version
          return get_versions()["version"]
                 ^^^^^^^^^^^^^^
        File "C:\Users\mark_\AppData\Local\Temp\pip-install-o32z7lvg\ncclient_d6901a081b784193a2e18d6426fd14db\versioneer.py", line 1412, in get_versions
          cfg = get_config_from_root(root)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\mark_\AppData\Local\Temp\pip-install-o32z7lvg\ncclient_d6901a081b784193a2e18d6426fd14db\versioneer.py", line 342, in get_config_from_root
          parser = configparser.SafeConfigParser()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'?
      [end of output]

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

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

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





Emily Zaiding

unread,
Nov 11, 2023, 10:34:18 AM11/11/23
to Junos Python EZ
Hey so I ran into this.


It can be solved by installing python 3.11
There is a dependency issue that isn't fully upgraded to support 3.12 yet

The best way to do it is through the use of virtual environments. Download and install python 3.11, and create a virtual environment in your project folder using the following:
Py 3.11 -m venv <.venv_name>
Activate the virtual environment
.\<.venv_name>\Scripts\activate<extension for your shell, either .bat or PS1>

Verify that the right python version is activated
Python --version

If 3.11 is active you can now use pip to install the package to the virtual environment
pip install junos-eznc

You also have to install any dependencies in this virtual environment as it is empty. For windows this is pip and ecdsa.

Hope this helps!

-Em
Reply all
Reply to author
Forward
0 new messages