salt: [BUG][3006rc1][3006rc2] Issues with installing napalm and python-ldap on onedir and in relenv based onedir

Description In trying to install 3 pip packages using salt-pip on 3005.1 OneDir on AlmaLinux 8, success becomes very dependent on order of installation (unlike installing in a venv or with system packages), and typically a package fails with some sort of issue with setuptools

Setup

# Initialize test environment
> mkdir salt-pip-vagrant && cd salt-pip-vagrant && vagrant init almalinux/8 && vagrant up && vagrant ssh

# Install python-ldap reqs:
[vagrant@localhost ~]$  sudo dnf install -y gcc openldap-devel
# Install Salt using devel salt-bootstrap to avoid https://github.com/saltstack/salt-bootstrap/issues/1876
[vagrant@localhost ~]$ curl -o bootstrap-salt.sh -L https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.sh
[vagrant@localhost ~]$ sudo sh bootstrap-salt.sh onedir

Please be as specific as possible and give set-up details.

  • on-prem machine
  • VM (Vagrant on VMware Workstation)
  • VM running on a cloud service, please be explicit and add details
  • container (Kubernetes, Docker, containerd, etc. please specify)
  • or a combination, please be explicit
  • jails if it is FreeBSD
  • classic packaging
  • onedir packaging
  • used bootstrap to install

Steps to Reproduce the behavior

Test with python-ldap and napalm (not successful):
[vagrant@localhost ~]$ sudo salt-pip install python-ldap napalm
Collecting python-ldap
  Downloading python-ldap-3.4.3.tar.gz (377 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 377.4/377.4 kB 51.9 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting napalm
  Downloading napalm-4.0.0-py2.py3-none-any.whl (266 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 266.2/266.2 kB 74.6 MB/s eta 0:00:00
Collecting pyasn1>=0.3.7
  Downloading pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.1/77.1 kB 33.2 MB/s eta 0:00:00
Collecting pyasn1-modules>=0.1.5
  Downloading pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 kB 54.7 MB/s eta 0:00:00
Collecting lxml>=4.3.0
  Downloading lxml-4.9.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (7.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.0/7.0 MB 59.0 MB/s eta 0:00:00
Requirement already satisfied: setuptools>=38.4.0 in /opt/saltstack/salt/run (from napalm) (60.6.0)
Requirement already satisfied: cffi>=1.11.3 in /opt/saltstack/salt/run (from napalm) (1.14.6)
Collecting textfsm<=1.1.2
  Downloading textfsm-1.1.2-py2.py3-none-any.whl (44 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 44.7/44.7 kB 20.0 MB/s eta 0:00:00
Collecting netutils>=1.0.0
  Downloading netutils-1.3.0-py3-none-any.whl (479 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 479.3/479.3 kB 35.9 MB/s eta 0:00:00
Requirement already satisfied: requests>=2.7.0 in /opt/saltstack/salt/run (from napalm) (2.25.1)
Requirement already satisfied: pyYAML in /opt/saltstack/salt/run (from napalm) (5.4.1)
Collecting future
  Downloading future-0.18.2.tar.gz (829 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 829.2/829.2 kB 66.2 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [54 lines of output]
      running egg_info
      creating /tmp/pip-pip-egg-info-wm5mhp43/future.egg-info
      writing /tmp/pip-pip-egg-info-wm5mhp43/future.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-pip-egg-info-wm5mhp43/future.egg-info/dependency_links.txt
      writing entry points to /tmp/pip-pip-egg-info-wm5mhp43/future.egg-info/entry_points.txt
      writing top-level names to /tmp/pip-pip-egg-info-wm5mhp43/future.egg-info/top_level.txt
      writing manifest file '/tmp/pip-pip-egg-info-wm5mhp43/future.egg-info/SOURCES.txt'
      Traceback (most recent call last):
        File "tiamatpip/cli.py", line 383, in _handle_runpy_return
          runpy_f(*args, **kwargs)
        File "runpy.py", line 87, in _run_code
        File "<tiamat-pip-run-code>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-i_k3f341/future_d066f84c8bf443bba3396347aa2571a2/setup.py", line 159, in <module>
          setup(name=NAME,
        File "setuptools/__init__.py", line 155, in setup
          return distutils.core.setup(**attrs)
        File "distutils/core.py", line 148, in setup
          dist.run_commands()
        File "distutils/dist.py", line 966, in run_commands
          self.run_command(cmd)
        File "distutils/dist.py", line 985, in run_command
          cmd_obj.run()
        File "setuptools/command/egg_info.py", line 299, in run
          self.find_sources()
        File "setuptools/command/egg_info.py", line 306, in find_sources
          mm.run()
        File "setuptools/command/egg_info.py", line 541, in run
          self.add_defaults()
        File "setuptools/command/egg_info.py", line 578, in add_defaults
          sdist.add_defaults(self)
        File "distutils/command/sdist.py", line 226, in add_defaults
          self._add_defaults_python()
        File "setuptools/command/sdist.py", line 111, in _add_defaults_python
          build_py = self.get_finalized_command('build_py')
        File "distutils/cmd.py", line 299, in get_finalized_command
          cmd_obj.ensure_finalized()
        File "distutils/cmd.py", line 107, in ensure_finalized
          self.finalize_options()
        File "setuptools/command/build_py.py", line 29, in finalize_options
          orig.build_py.finalize_options(self)
        File "distutils/command/build_py.py", line 43, in finalize_options
          self.set_undefined_options('build',
        File "distutils/cmd.py", line 286, in set_undefined_options
          src_cmd_obj = self.distribution.get_command_obj(src_cmd)
        File "distutils/dist.py", line 857, in get_command_obj
          klass = self.get_command_class(command)
        File "setuptools/dist.py", line 901, in get_command_class
          self.cmdclass[command] = cmdclass = ep.load()
        File "pkg_resources/__init__.py", line 2480, in load
          return self.resolve()
        File "pkg_resources/__init__.py", line 2486, in resolve
          module = __import__(self.module_name, fromlist=['__name__'], level=0)
      ModuleNotFoundError: No module named 'setuptools.command.build'
      [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.

[vagrant@localhost ~]$ sudo salt-pip list
Package    Version
---------- -------
setuptools 65.6.3
wheel      0.38.4
Test with python-ldap and capirca (successful):
[vagrant@localhost ~]$ exit
> vagrant destroy -f && vagrant up && vagrant ssh
# Install python-ldap reqs:
[vagrant@localhost ~]$  sudo dnf install -y gcc openldap-devel
# Install Salt using devel salt-bootstrap to avoid https://github.com/saltstack/salt-bootstrap/issues/1876
[vagrant@localhost ~]$ curl -o bootstrap-salt.sh -L https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.sh
[vagrant@localhost ~]$ sudo sh bootstrap-salt.sh onedir
[vagrant@localhost ~]$ sudo salt-pip install python-ldap capirca
Collecting python-ldap
  Downloading python-ldap-3.4.3.tar.gz (377 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 377.4/377.4 kB 39.9 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting capirca
  Downloading capirca-2.0.6-py3-none-any.whl (224 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 224.4/224.4 kB 83.2 MB/s eta 0:00:00
Collecting pyasn1-modules>=0.1.5
  Downloading pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 kB 58.7 MB/s eta 0:00:00
Collecting pyasn1>=0.3.7
  Downloading pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.1/77.1 kB 21.1 MB/s eta 0:00:00
Collecting ipaddress>=1.0.22
  Downloading ipaddress-1.0.23-py2.py3-none-any.whl (18 kB)
Collecting ply
  Downloading ply-3.11-py2.py3-none-any.whl (49 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 49.6/49.6 kB 22.8 MB/s eta 0:00:00
Collecting absl-py
  Downloading absl_py-1.3.0-py3-none-any.whl (124 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 124.6/124.6 kB 28.8 MB/s eta 0:00:00
Requirement already satisfied: PyYAML in /opt/saltstack/salt/run (from capirca) (5.4.1)
Requirement already satisfied: six in /opt/saltstack/salt/run (from capirca) (1.16.0)
Collecting mock
  Downloading mock-4.0.3-py3-none-any.whl (28 kB)
Building wheels for collected packages: python-ldap
  Building wheel for python-ldap (pyproject.toml) ... done
  Created wheel for python-ldap: filename=python_ldap-3.4.3-cp39-cp39-linux_x86_64.whl size=215440 sha256=da76b3349c2a729a483b13fa54717fa9af118d79bb11d485d1ef6beddd26830e
  Stored in directory: /root/.cache/pip/wheels/79/43/5e/1a029878450f5949466f351db7ff4c5459c0b1937999f39000
Successfully built python-ldap
Installing collected packages: pyasn1, ply, ipaddress, pyasn1-modules, mock, absl-py, python-ldap, capirca
Successfully installed absl-py-1.3.0 capirca-2.0.6 ipaddress-1.0.23 mock-4.0.3 ply-3.11 pyasn1-0.4.8 pyasn1-modules-0.2.8 python-ldap-3.4.3
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[vagrant@localhost ~]$ sudo salt-pip list
Package        Version
-------------- -------
absl-py        1.3.0
capirca        2.0.6
ipaddress      1.0.23
mock           4.0.3
ply            3.11
pyasn1         0.4.8
pyasn1-modules 0.2.8
python-ldap    3.4.3
setuptools     65.6.3
wheel          0.38.4
Test with napalm and capirca (successful):
[vagrant@localhost ~]$ exit
> vagrant destroy -f && vagrant up && vagrant ssh
# Install python-ldap reqs:
[vagrant@localhost ~]$  sudo dnf install -y gcc openldap-devel
# Install Salt using devel salt-bootstrap to avoid https://github.com/saltstack/salt-bootstrap/issues/1876
[vagrant@localhost ~]$ curl -o bootstrap-salt.sh -L https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.sh
[vagrant@localhost ~]$ sudo sh bootstrap-salt.sh onedir
[vagrant@localhost ~]$ sudo salt-pip install napalm capirca
Collecting napalm
  Downloading napalm-4.0.0-py2.py3-none-any.whl (266 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 266.2/266.2 kB 7.0 MB/s eta 0:00:00
Collecting capirca
  Downloading capirca-2.0.6-py3-none-any.whl (224 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 224.4/224.4 kB 21.8 MB/s eta 0:00:00
Collecting paramiko>=2.6.0
  Downloading paramiko-2.12.0-py2.py3-none-any.whl (213 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 213.1/213.1 kB 56.4 MB/s eta 0:00:00
Collecting textfsm<=1.1.2
  Downloading textfsm-1.1.2-py2.py3-none-any.whl (44 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 44.7/44.7 kB 14.6 MB/s eta 0:00:00
Collecting lxml>=4.3.0
  Downloading lxml-4.9.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (7.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.0/7.0 MB 62.1 MB/s eta 0:00:00
Requirement already satisfied: jinja2 in /opt/saltstack/salt/run (from napalm) (3.1.0)
Collecting ttp
  Downloading ttp-0.9.1-py2.py3-none-any.whl (84 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 84.7/84.7 kB 36.0 MB/s eta 0:00:00
Collecting junos-eznc>=2.6.3
  Downloading junos_eznc-2.6.5-py2.py3-none-any.whl (197 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 197.4/197.4 kB 60.4 MB/s eta 0:00:00
Requirement already satisfied: requests>=2.7.0 in /opt/saltstack/salt/run (from napalm) (2.25.1)
Collecting netutils>=1.0.0
  Downloading netutils-1.3.0-py3-none-any.whl (479 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 479.3/479.3 kB 23.2 MB/s eta 0:00:00
Collecting scp
  Downloading scp-0.14.4-py2.py3-none-any.whl (8.6 kB)
Collecting future
  Downloading future-0.18.2.tar.gz (829 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 829.2/829.2 kB 43.2 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: setuptools>=38.4.0 in /opt/saltstack/salt/run (from napalm) (60.6.0)
Collecting netmiko>=4.0.0
  Downloading netmiko-4.1.2-py3-none-any.whl (196 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 196.8/196.8 kB 45.4 MB/s eta 0:00:00
Collecting ncclient
  Downloading ncclient-0.6.13.tar.gz (105 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 105.7/105.7 kB 46.1 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting ttp-templates
  Downloading ttp_templates-0.3.1-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 kB 11.6 MB/s eta 0:00:00
Collecting typing-extensions>=4.3.0
  Downloading typing_extensions-4.4.0-py3-none-any.whl (26 kB)
Collecting netaddr
  Downloading netaddr-0.8.0-py2.py3-none-any.whl (1.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.9/1.9 MB 80.2 MB/s eta 0:00:00
Collecting pyeapi>=0.8.2
  Downloading pyeapi-0.8.4.tar.gz (138 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 138.1/138.1 kB 30.6 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: pyYAML in /opt/saltstack/salt/run (from napalm) (5.4.1)
Requirement already satisfied: cffi>=1.11.3 in /opt/saltstack/salt/run (from napalm) (1.14.6)
Collecting absl-py
  Downloading absl_py-1.3.0-py3-none-any.whl (124 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 124.6/124.6 kB 27.0 MB/s eta 0:00:00
Collecting ipaddress>=1.0.22
  Downloading ipaddress-1.0.23-py2.py3-none-any.whl (18 kB)
Collecting ply
  Downloading ply-3.11-py2.py3-none-any.whl (49 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 49.6/49.6 kB 14.6 MB/s eta 0:00:00
Requirement already satisfied: six in /opt/saltstack/salt/run (from capirca) (1.16.0)
Collecting mock
  Downloading mock-4.0.3-py3-none-any.whl (28 kB)
Requirement already satisfied: pycparser in /opt/saltstack/salt/run (from cffi>=1.11.3->napalm) (2.21)
Collecting pyserial
  Downloading pyserial-3.5-py2.py3-none-any.whl (90 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.6/90.6 kB 35.9 MB/s eta 0:00:00
Collecting pyparsing
  Downloading pyparsing-3.0.9-py3-none-any.whl (98 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 98.3/98.3 kB 41.1 MB/s eta 0:00:00
Collecting yamlordereddictloader
  Downloading yamlordereddictloader-0.4.0.tar.gz (3.3 kB)
  Preparing metadata (setup.py) ... done
Collecting transitions
  Downloading transitions-0.9.0-py2.py3-none-any.whl (97 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.7/97.7 kB 42.5 MB/s eta 0:00:00
Requirement already satisfied: MarkupSafe>=2.0 in /opt/saltstack/salt/run (from jinja2->napalm) (2.0.1)
Collecting ntc-templates>=2.0.0
  Downloading ntc_templates-3.1.0-py3-none-any.whl (332 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 332.4/332.4 kB 42.4 MB/s eta 0:00:00
Collecting tenacity
  Downloading tenacity-8.1.0-py3-none-any.whl (23 kB)
Collecting bcrypt>=3.1.3
  Downloading bcrypt-4.0.1-cp36-abi3-manylinux_2_28_x86_64.whl (593 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 593.7/593.7 kB 64.7 MB/s eta 0:00:00
Requirement already satisfied: cryptography>=2.5 in /opt/saltstack/salt/run (from paramiko>=2.6.0->napalm) (3.3.2)
Collecting pynacl>=1.0.1
  Downloading PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (856 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 856.7/856.7 kB 82.8 MB/s eta 0:00:00
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /opt/saltstack/salt/run (from requests>=2.7.0->napalm) (1.26.6)
Requirement already satisfied: certifi>=2017.4.17 in /opt/saltstack/salt/run (from requests>=2.7.0->napalm) (2022.5.18.1)
Requirement already satisfied: chardet<5,>=3.0.2 in /opt/saltstack/salt/run (from requests>=2.7.0->napalm) (3.0.4)
Requirement already satisfied: idna<3,>=2.5 in /opt/saltstack/salt/run (from requests>=2.7.0->napalm) (2.8)
Building wheels for collected packages: ncclient, pyeapi, future, yamlordereddictloader
  Building wheel for ncclient (setup.py) ... done
  Created wheel for ncclient: filename=ncclient-0.6.13-py2.py3-none-any.whl size=84646 sha256=1e2309afbf2fc1da526351d6875caa04015b5e65a1c3db783e9e8192e70d15fe
  Stored in directory: /root/.cache/pip/wheels/09/6a/19/71c39c626047324b1b4a66766ea7d03123d3cb1f8f1c2233d8
  Building wheel for pyeapi (setup.py) ... done
  Created wheel for pyeapi: filename=pyeapi-0.8.4-py3-none-any.whl size=90623 sha256=23e2b0e52af2bda28835139c184e7f0bdb6f16dc7bbc6ea63912c080ec7ae55f
  Stored in directory: /root/.cache/pip/wheels/ec/16/22/b00b0737cfca0f4da4f33aff6f797b383dc0a5bf4b51017908
  Building wheel for future (setup.py) ... done
  Created wheel for future: filename=future-0.18.2-py3-none-any.whl size=491070 sha256=1c5099eec1abc02e0c5314ffe2292cbceb7c8932f3eefacb6976e5ca3e681572
  Stored in directory: /root/.cache/pip/wheels/2f/a0/d3/4030d9f80e6b3be787f19fc911b8e7aa462986a40ab1e4bb94
  Building wheel for yamlordereddictloader (setup.py) ... done
  Created wheel for yamlordereddictloader: filename=yamlordereddictloader-0.4.0-py3-none-any.whl size=4086 sha256=771c953091fe26bc8a7d394f1e6d533c91e3f04b7617ec4b4795fff39cad0622
  Stored in directory: /root/.cache/pip/wheels/26/be/2c/114a2da8d1eca28fc4ec769eab3304e854a8a2b5ca217ff9c5
Successfully built ncclient pyeapi future yamlordereddictloader
Installing collected packages: pyserial, ply, netaddr, ipaddress, yamlordereddictloader, typing-extensions, ttp, transitions, tenacity, pyparsing, pyeapi, netutils, mock, lxml, future, bcrypt, absl-py, ttp-templates, textfsm, pynacl, capirca, paramiko, ntc-templates, scp, ncclient, netmiko, junos-eznc, napalm
Successfully installed absl-py-1.3.0 bcrypt-4.0.1 capirca-2.0.6 future-0.18.2 ipaddress-1.0.23 junos-eznc-2.6.5 lxml-4.9.1 mock-4.0.3 napalm-4.0.0 ncclient-0.6.13 netaddr-0.8.0 netmiko-4.1.2 netutils-1.3.0 ntc-templates-3.1.0 paramiko-2.12.0 ply-3.11 pyeapi-0.8.4 pynacl-1.5.0 pyparsing-3.0.9 pyserial-3.5 scp-0.14.4 tenacity-8.1.0 textfsm-1.1.2 transitions-0.9.0 ttp-0.9.1 ttp-templates-0.3.1 typing-extensions-4.4.0 yamlordereddictloader-0.4.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[vagrant@localhost ~]$ sudo salt-pip list
Package               Version
--------------------- -------
absl-py               1.3.0
bcrypt                4.0.1
capirca               2.0.6
future                0.18.2
ipaddress             1.0.23
junos-eznc            2.6.5
lxml                  4.9.1
mock                  4.0.3
napalm                4.0.0
ncclient              0.6.13
netaddr               0.8.0
netmiko               4.1.2
netutils              1.3.0
ntc-templates         3.1.0
paramiko              2.12.0
ply                   3.11
pyeapi                0.8.4
PyNaCl                1.5.0
pyparsing             3.0.9
pyserial              3.5
scp                   0.14.4
tenacity              8.1.0
textfsm               1.1.2
transitions           0.9.0
ttp                   0.9.1
ttp-templates         0.3.1
typing_extensions     4.4.0
yamlordereddictloader 0.4.0
Add python-ldap after napalm and capirca (successful):
[vagrant@localhost ~]$ sudo salt-pip install python-ldap
Collecting python-ldap
  Downloading python-ldap-3.4.3.tar.gz (377 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 377.4/377.4 kB 72.0 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pyasn1>=0.3.7
  Downloading pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.1/77.1 kB 24.9 MB/s eta 0:00:00
Collecting pyasn1-modules>=0.1.5
  Downloading pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 kB 63.3 MB/s eta 0:00:00
Building wheels for collected packages: python-ldap
  Building wheel for python-ldap (pyproject.toml) ... done
  Created wheel for python-ldap: filename=python_ldap-3.4.3-cp39-cp39-linux_x86_64.whl size=215438 sha256=1ad60631210119718279c00a231b85e9b569dfa562c7b4cf6b1d8977ae6a4b4c
  Stored in directory: /root/.cache/pip/wheels/79/43/5e/1a029878450f5949466f351db7ff4c5459c0b1937999f39000
Successfully built python-ldap
Installing collected packages: pyasn1, pyasn1-modules, python-ldap
Successfully installed pyasn1-0.4.8 pyasn1-modules-0.2.8 python-ldap-3.4.3
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[vagrant@localhost ~]$ sudo salt-pip list
Package               Version
--------------------- -------
absl-py               1.3.0
bcrypt                4.0.1
capirca               2.0.6
future                0.18.2
ipaddress             1.0.23
junos-eznc            2.6.5
lxml                  4.9.1
mock                  4.0.3
napalm                4.0.0
ncclient              0.6.13
netaddr               0.8.0
netmiko               4.1.2
netutils              1.3.0
ntc-templates         3.1.0
paramiko              2.12.0
ply                   3.11
pyasn1                0.4.8
pyasn1-modules        0.2.8
pyeapi                0.8.4
PyNaCl                1.5.0
pyparsing             3.0.9
pyserial              3.5
python-ldap           3.4.3
scp                   0.14.4
setuptools            65.6.3
tenacity              8.1.0
textfsm               1.1.2
transitions           0.9.0
ttp                   0.9.1
ttp-templates         0.3.1
typing_extensions     4.4.0
wheel                 0.38.4
yamlordereddictloader 0.4.0
Test with python 3.8 virtualenv (successful):
[vagrant@localhost ~]$ exit
> vagrant destroy -f && vagrant up && vagrant ssh
# Install python-ldap reqs:
[vagrant@localhost ~]$ sudo dnf install -y gcc openldap-devel python38 python38-devel
[vagrant@localhost ~]$ mkdir venv-test && cd venv-test && python3 -m venv venv && source venv/bin/activate
(venv) [vagrant@localhost venv-test]$ pip install python-ldap napalm capirca
Collecting python-ldap
  Downloading https://files.pythonhosted.org/packages/3a/7d/de9ae3e5843de77eae3a60c1e70ef5cad9960db50521e8459f7d567a1d1d/python-ldap-3.4.3.tar.gz (377kB)
     |████████████████████████████████| 378kB 5.0MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting napalm
  Downloading https://files.pythonhosted.org/packages/8f/4e/9a05d767765522c95c05cb5b460198d7c7585c51553827cd84c557a920c2/napalm-4.0.0-py2.py3-none-any.whl (266kB)
     |████████████████████████████████| 266kB 43.0MB/s
Collecting capirca
  Downloading https://files.pythonhosted.org/packages/cc/31/5fa4f85c8b0d48162deced86d441c5b25f2ae4491d5053144e2557636330/capirca-2.0.6-py3-none-any.whl (224kB)
     |████████████████████████████████| 225kB 68.6MB/s
Collecting pyasn1>=0.3.7
  Downloading https://files.pythonhosted.org/packages/62/1e/a94a8d635fa3ce4cfc7f506003548d0a2447ae76fd5ca53932970fe3053f/pyasn1-0.4.8-py2.py3-none-any.whl (77kB)
     |████████████████████████████████| 81kB 31.0MB/s
Collecting pyasn1-modules>=0.1.5
  Downloading https://files.pythonhosted.org/packages/95/de/214830a981892a3e286c3794f41ae67a4495df1108c3da8a9f62159b9a9d/pyasn1_modules-0.2.8-py2.py3-none-any.whl (155kB)
     |████████████████████████████████| 163kB 76.4MB/s
Requirement already satisfied: setuptools>=38.4.0 in ./venv/lib/python3.8/site-packages (from napalm) (41.6.0)
Collecting scp
  Downloading https://files.pythonhosted.org/packages/7c/85/595a938d24bf4c88fe3ca4424ec9d934175fee800278769c7d4257dcf11a/scp-0.14.4-py2.py3-none-any.whl
Collecting ncclient
  Downloading https://files.pythonhosted.org/packages/ee/6f/ef2796c82d097dbead1b804db8457fc8fdc244e3d6860eb0a702315dbf67/ncclient-0.6.13.tar.gz (105kB)
     |████████████████████████████████| 112kB 91.6MB/s
Collecting pyeapi>=0.8.2
  Downloading https://files.pythonhosted.org/packages/a2/30/05d37e23c3d718cccf475e6664afae37d96af6601c03d3c6eae4bb480ac4/pyeapi-0.8.4.tar.gz (138kB)
     |████████████████████████████████| 143kB 65.0MB/s
Collecting requests>=2.7.0
  Downloading https://files.pythonhosted.org/packages/ca/91/6d9b8ccacd0412c08820f72cebaa4f0c0441b5cda699c90f618b6f8a1b42/requests-2.28.1-py3-none-any.whl (62kB)
     |████████████████████████████████| 71kB 30.5MB/s
Collecting future
  Downloading https://files.pythonhosted.org/packages/45/0b/38b06fd9b92dc2b68d58b75f900e97884c45bedd2ff83203d933cf5851c9/future-0.18.2.tar.gz (829kB)
     |████████████████████████████████| 829kB 14.1MB/s
Collecting ttp
  Downloading https://files.pythonhosted.org/packages/4c/4f/1be009e73a1af641856250d64995d740672d9c746a7c93363611af163ad2/ttp-0.9.1-py2.py3-none-any.whl (84kB)
     |████████████████████████████████| 92kB 24.0MB/s
Collecting junos-eznc>=2.6.3
  Downloading https://files.pythonhosted.org/packages/27/25/b965d1d2d28beb1b9ab7ec7efba82ad7d065cbfb4d5ea63cd53dc4036258/junos_eznc-2.6.5-py2.py3-none-any.whl (197kB)
     |████████████████████████████████| 204kB 90.4MB/s
Collecting netaddr
  Downloading https://files.pythonhosted.org/packages/ff/cd/9cdfea8fc45c56680b798db6a55fa60a22e2d3d3ccf54fc729d083b50ce4/netaddr-0.8.0-py2.py3-none-any.whl (1.9MB)
     |████████████████████████████████| 1.9MB 5.0MB/s
Collecting netutils>=1.0.0
  Downloading https://files.pythonhosted.org/packages/b5/91/220e757932fa3ba99874343dd632121dc6c348f798ec4100b392a128f538/netutils-1.3.0-py3-none-any.whl (479kB)
     |████████████████████████████████| 481kB 23.9MB/s
Collecting paramiko>=2.6.0
  Downloading https://files.pythonhosted.org/packages/71/6d/95777fd66507106d2f8f81d005255c237187951644f85a5bd0baeec8a88f/paramiko-2.12.0-py2.py3-none-any.whl (213kB)
     |████████████████████████████████| 215kB 41.4MB/s
Collecting textfsm<=1.1.2
  Downloading https://files.pythonhosted.org/packages/8e/74/e4f66bf3b3829e063b30501b586b1a489bd664b9066bf74650845e4c6352/textfsm-1.1.2-py2.py3-none-any.whl (44kB)
     |████████████████████████████████| 51kB 20.1MB/s
Collecting typing-extensions>=4.3.0
  Downloading https://files.pythonhosted.org/packages/0b/8e/f1a0a5a76cfef77e1eb6004cb49e5f8d72634da638420b9ea492ce8305e8/typing_extensions-4.4.0-py3-none-any.whl
Collecting pyYAML
  Downloading https://files.pythonhosted.org/packages/d7/42/7ad4b6d67a16229496d4f6e74201bdbebcf4bc1e87d5a70c9297d4961bd2/PyYAML-6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (701kB)
     |████████████████████████████████| 706kB 18.3MB/s
Collecting netmiko>=4.0.0
  Downloading https://files.pythonhosted.org/packages/14/8f/0301558593a278188b1edeabbf082b7a16d73c1bf672cf8b856068152fb6/netmiko-4.1.2-py3-none-any.whl (196kB)
     |████████████████████████████████| 204kB 40.5MB/s
Collecting lxml>=4.3.0
  Downloading https://files.pythonhosted.org/packages/ec/e6/b10a2233c77d21aaa55fbc766ab70d292bf0c38545cc226a886904f949cb/lxml-4.9.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (6.9MB)
     |████████████████████████████████| 6.9MB 13.7MB/s
Collecting ttp-templates
  Downloading https://files.pythonhosted.org/packages/86/d9/b34546d71928a9a964f92e5ff833c4d0758b558e39e54242e9fbadb0e117/ttp_templates-0.3.1-py3-none-any.whl (61kB)
     |████████████████████████████████| 71kB 26.7MB/s
Collecting jinja2
  Downloading https://files.pythonhosted.org/packages/bc/c3/f068337a370801f372f2f8f6bad74a5c140f6fda3d9de154052708dd3c65/Jinja2-3.1.2-py3-none-any.whl (133kB)
     |████████████████████████████████| 133kB 77.9MB/s
Collecting cffi>=1.11.3
  Downloading https://files.pythonhosted.org/packages/b7/8b/06f30caa03b5b3ac006de4f93478dbd0239e2a16566d81a106c322dc4f79/cffi-1.15.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (442kB)
     |████████████████████████████████| 450kB 22.8MB/s
Collecting mock
  Downloading https://files.pythonhosted.org/packages/5c/03/b7e605db4a57c0f6fba744b11ef3ddf4ddebcada35022927a2b5fc623fdf/mock-4.0.3-py3-none-any.whl
Collecting ipaddress>=1.0.22
  Downloading https://files.pythonhosted.org/packages/c2/f8/49697181b1651d8347d24c095ce46c7346c37335ddc7d255833e7cde674d/ipaddress-1.0.23-py2.py3-none-any.whl
Collecting six
  Downloading https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl
Collecting absl-py
  Downloading https://files.pythonhosted.org/packages/2c/39/ba081c6f7837366a39c9286fa1bc9dbf217249df80e133f25c62b05d1a53/absl_py-1.3.0-py3-none-any.whl (124kB)
     |████████████████████████████████| 133kB 62.5MB/s
Collecting ply
  Downloading https://files.pythonhosted.org/packages/a3/58/35da89ee790598a0700ea49b2a66594140f44dec458c07e8e3d4979137fc/ply-3.11-py2.py3-none-any.whl (49kB)
     |████████████████████████████████| 51kB 21.2MB/s
Collecting charset-normalizer<3,>=2
  Downloading https://files.pythonhosted.org/packages/db/51/a507c856293ab05cdc1db77ff4bc1268ddd39f29e7dc4919aa497f0adbec/charset_normalizer-2.1.1-py3-none-any.whl
Collecting idna<4,>=2.5
  Downloading https://files.pythonhosted.org/packages/fc/34/3030de6f1370931b9dbb4dad48f6ab1015ab1d32447850b9fc94e60097be/idna-3.4-py3-none-any.whl (61kB)
     |████████████████████████████████| 71kB 24.7MB/s
Collecting urllib3<1.27,>=1.21.1
  Downloading https://files.pythonhosted.org/packages/65/0c/cc6644eaa594585e5875f46f3c83ee8762b647b51fc5b0fb253a242df2dc/urllib3-1.26.13-py2.py3-none-any.whl (140kB)
     |████████████████████████████████| 143kB 71.9MB/s
Collecting certifi>=2017.4.17
  Downloading https://files.pythonhosted.org/packages/1d/38/fa96a426e0c0e68aabc68e896584b83ad1eec779265a028e156ce509630e/certifi-2022.9.24-py3-none-any.whl (161kB)
     |████████████████████████████████| 163kB 6.4MB/s
Collecting transitions
  Downloading https://files.pythonhosted.org/packages/ee/35/77e8f975da682e14e1581ae0f47f4e3beed29871794f26ce7c9d4dd32b14/transitions-0.9.0-py2.py3-none-any.whl (97kB)
     |████████████████████████████████| 102kB 28.3MB/s
Collecting pyserial
  Downloading https://files.pythonhosted.org/packages/07/bc/587a445451b253b285629263eb51c2d8e9bcea4fc97826266d186f96f558/pyserial-3.5-py2.py3-none-any.whl (90kB)
     |████████████████████████████████| 92kB 31.4MB/s
Collecting yamlordereddictloader
  Downloading https://files.pythonhosted.org/packages/56/e1/1ca77da64cc355f0de483095e841d96f2366f93b095b83869440a296c21d/yamlordereddictloader-0.4.0.tar.gz
Collecting pyparsing
  Downloading https://files.pythonhosted.org/packages/6c/10/a7d0fa5baea8fe7b50f448ab742f26f52b80bfca85ac2be9d35cdd9a3246/pyparsing-3.0.9-py3-none-any.whl (98kB)
     |████████████████████████████████| 102kB 27.2MB/s
Collecting bcrypt>=3.1.3
  Downloading https://files.pythonhosted.org/packages/aa/48/fd2b197a9741fa790ba0b88a9b10b5e88e62ff5cf3e1bc96d8354d7ce613/bcrypt-4.0.1-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (593kB)
     |████████████████████████████████| 593kB 17.7MB/s
Collecting cryptography>=2.5
  Downloading https://files.pythonhosted.org/packages/63/d4/66b3b4ffe51b47a065b5a5a00e6a4c8aa6cdfa4f2453adfa0aac77fd3511/cryptography-38.0.4-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1MB)
     |████████████████████████████████| 4.2MB 24.7MB/s
Collecting pynacl>=1.0.1
  Downloading https://files.pythonhosted.org/packages/ee/87/f1bb6a595f14a327e8285b9eb54d41fef76c585a0edef0a45f6fc95de125/PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (856kB)
     |████████████████████████████████| 860kB 10.9MB/s
Collecting tenacity
  Downloading https://files.pythonhosted.org/packages/a5/94/933ce16d18450ccf518a6da5bd51418611e8776b992070b9f40b2f9cedff/tenacity-8.1.0-py3-none-any.whl
Collecting ntc-templates>=2.0.0
  Downloading https://files.pythonhosted.org/packages/ba/2f/3a6b79786c45366f1207120fe493285bbcb9fb781904da855a9791a8c8d3/ntc_templates-3.1.0-py3-none-any.whl (332kB)
     |████████████████████████████████| 337kB 40.0MB/s
Collecting MarkupSafe>=2.0
  Downloading https://files.pythonhosted.org/packages/fd/f4/524d2e8f5a3727cf309c2b7df7c732038375322df1376c9e9ef3aa92fcaf/MarkupSafe-2.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Collecting pycparser
  Downloading https://files.pythonhosted.org/packages/62/d5/5f610ebe421e85889f2e55e33b7f9a6795bd982198517d912eb1c76e1a53/pycparser-2.21-py2.py3-none-any.whl (118kB)
     |████████████████████████████████| 122kB 52.5MB/s
Building wheels for collected packages: python-ldap
  Building wheel for python-ldap (PEP 517) ... done
  Created wheel for python-ldap: filename=python_ldap-3.4.3-cp38-cp38-linux_x86_64.whl size=337379 sha256=b9ed3a03d2ac96495cbeb3abb966d9773bd107ee35a27842fe643fc53bb4f9dc
  Stored in directory: /home/vagrant/.cache/pip/wheels/ed/65/c1/5517d25f8046fdca995660f9bf0d6439e23ae25be05dc4b040
Successfully built python-ldap
Installing collected packages: pyasn1, pyasn1-modules, python-ldap, six, bcrypt, pycparser, cffi, cryptography, pynacl, paramiko, scp, lxml, ncclient, netaddr, pyeapi, charset-normalizer, idna, urllib3, certifi, requests, future, ttp, transitions, pyserial, pyYAML, yamlordereddictloader, MarkupSafe, jinja2, pyparsing, junos-eznc, netutils, textfsm, typing-extensions, tenacity, ntc-templates, netmiko, ttp-templates, napalm, mock, ipaddress, absl-py, ply, capirca
    Running setup.py install for ncclient ... done
    Running setup.py install for pyeapi ... done
    Running setup.py install for future ... done
    Running setup.py install for yamlordereddictloader ... done
Successfully installed MarkupSafe-2.1.1 absl-py-1.3.0 bcrypt-4.0.1 capirca-2.0.6 certifi-2022.9.24 cffi-1.15.1 charset-normalizer-2.1.1 cryptography-38.0.4 future-0.18.2 idna-3.4 ipaddress-1.0.23 jinja2-3.1.2 junos-eznc-2.6.5 lxml-4.9.1 mock-4.0.3 napalm-4.0.0 ncclient-0.6.13 netaddr-0.8.0 netmiko-4.1.2 netutils-1.3.0 ntc-templates-3.1.0 paramiko-2.12.0 ply-3.11 pyYAML-6.0 pyasn1-0.4.8 pyasn1-modules-0.2.8 pycparser-2.21 pyeapi-0.8.4 pynacl-1.5.0 pyparsing-3.0.9 pyserial-3.5 python-ldap-3.4.3 requests-2.28.1 scp-0.14.4 six-1.16.0 tenacity-8.1.0 textfsm-1.1.2 transitions-0.9.0 ttp-0.9.1 ttp-templates-0.3.1 typing-extensions-4.4.0 urllib3-1.26.13 yamlordereddictloader-0.4.0
WARNING: You are using pip version 19.3.1; however, version 22.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

(venv) [vagrant@localhost venv-test]$ pip list
Package               Version
--------------------- ---------
absl-py               1.3.0
bcrypt                4.0.1
capirca               2.0.6
certifi               2022.9.24
cffi                  1.15.1
charset-normalizer    2.1.1
cryptography          38.0.4
future                0.18.2
idna                  3.4
ipaddress             1.0.23
Jinja2                3.1.2
junos-eznc            2.6.5
lxml                  4.9.1
MarkupSafe            2.1.1
mock                  4.0.3
napalm                4.0.0
ncclient              0.6.13
netaddr               0.8.0
netmiko               4.1.2
netutils              1.3.0
ntc-templates         3.1.0
paramiko              2.12.0
pip                   19.3.1
ply                   3.11
pyasn1                0.4.8
pyasn1-modules        0.2.8
pycparser             2.21
pyeapi                0.8.4
PyNaCl                1.5.0
pyparsing             3.0.9
pyserial              3.5
python-ldap           3.4.3
PyYAML                6.0
requests              2.28.1
scp                   0.14.4
setuptools            41.6.0
six                   1.16.0
tenacity              8.1.0
textfsm               1.1.2
transitions           0.9.0
ttp                   0.9.1
ttp-templates         0.3.1
typing-extensions     4.4.0
urllib3               1.26.13
yamlordereddictloader 0.4.0
WARNING: You are using pip version 19.3.1; however, version 22.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Expected behavior python-ldap and napalm, and capirca pip packages are installed properly.

Screenshots If applicable, add screenshots to help explain your problem.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3005.1

Dependency Versions:
          cffi: 1.14.6
      cherrypy: 18.6.1
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.0
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.9.8
        pygit2: Not Installed
        Python: 3.9.15 (main, Nov  8 2022, 03:47:03)
  python-gnupg: 0.4.8
        PyYAML: 5.4.1
         PyZMQ: 23.2.0
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: almalinux 8.6 Sky Tiger
        locale: utf-8
       machine: x86_64
       release: 4.18.0-372.26.1.el8_6.x86_64
        system: Linux
       version: AlmaLinux 8.6 Sky Tiger

Additional context I’ve seen similar issues where the order of installation of pip packages matter, particularly with the salt-ext-vmware extension and dependencies

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (16 by maintainers)

Most upvoted comments

In the newest version of relenv which is included in 3006.0. Pip installing works the same way as with a virtualenv, by default. You will no longer need to provide any environment variables to install against system libraries