Salt: [BUG] While trying to install salt using pip, package "distro" is a requirement

Created on 20 Apr 2020  路  3Comments  路  Source: saltstack/salt

Description
Installing salt via pip3 requires a missing dependency

Setup
Install pip via python3.8 through get-pip.py on Ubuntu 18.04

Steps to Reproduce the behavior

pip install salt
Collecting salt
  Downloading salt-3000.1.tar.gz (15.2 MB)
     |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 15.2 MB 2.2 MB/s
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-73zu27wr/salt/setup.py'"'"'; __file__='"'"'/tmp/pip-install-73zu27wr/salt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-73zu27wr/salt/pip-egg-info
         cwd: /tmp/pip-install-73zu27wr/salt/
    Complete output (45 lines):
    Traceback (most recent call last):
      File "/tmp/pip-install-73zu27wr/salt/salt/version.py", line 15, in <module>
        from platform import linux_distribution as _deprecated_linux_distribution
    ImportError: cannot import name 'linux_distribution' from 'platform' (/usr/lib/python3.8/platform.py)

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-73zu27wr/salt/setup.py", line 126, in <module>
        exec(compile(open(SALT_VERSION).read(), SALT_VERSION, 'exec'))
      File "/tmp/pip-install-73zu27wr/salt/salt/version.py", line 22, in <module>
        from distro import linux_distribution
    ModuleNotFoundError: No module named 'distro'
    Error in sys.excepthook:
    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
        from apport.fileutils import likely_packaged, get_recent_crashes
      File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
        from apport.report import Report
      File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
        import apport.fileutils
      File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
        from apport.packaging_impl import impl as packaging
      File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module>
        import apt
      File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
        import apt_pkg
    ModuleNotFoundError: No module named 'apt_pkg'

    Original exception was:
    Traceback (most recent call last):
      File "/tmp/pip-install-73zu27wr/salt/salt/version.py", line 15, in <module>
        from platform import linux_distribution as _deprecated_linux_distribution
    ImportError: cannot import name 'linux_distribution' from 'platform' (/usr/lib/python3.8/platform.py)

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-73zu27wr/salt/setup.py", line 126, in <module>
        exec(compile(open(SALT_VERSION).read(), SALT_VERSION, 'exec'))
      File "/tmp/pip-install-73zu27wr/salt/salt/version.py", line 22, in <module>
        from distro import linux_distribution
    ModuleNotFoundError: No module named 'distro'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Expected behavior
Salt should be installed via pip

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: 3000.1

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.6.1
      docker-py: Not Installed
          gitdb: 2.0.3
      gitpython: 2.1.8
         Jinja2: 2.10
        libgit2: Not Installed
       M2Crypto: Not Installed
           Mako: 1.0.7
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.17 (default, Nov  7 2019, 10:07:09)
   python-gnupg: 0.4.1
         PyYAML: 3.12
          PyZMQ: 16.0.2
          smmap: 2.0.3
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.2.5

System Versions:
           dist: Ubuntu 18.04 bionic
         locale: UTF-8
        machine: x86_64
        release: 4.15.0-96-generic
         system: Linux
        version: Ubuntu 18.04 bionic

Additional context
Add any other context about the problem here.

Bug Pending Discussion

All 3 comments

@allyunion Thank you!

Salt does not currently support Python3.8.

@alexey-zhukovin I tested on 3.6. It doesnt depend on which python is being used

Step 20/59 : RUN pip install /salt
 ---> Running in fdbc590b2d01
Processing /salt
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python /usr/local/lib/python3.6/dist-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpvcz4rv_u
       cwd: /tmp/pip-req-build-97jmi08l
  Complete output (20 lines):
  Traceback (most recent call last):
    File "/usr/local/lib/python3.6/dist-packages/pip/_vendor/pep517/_in_process.py", line 257, in <module>
      main()
    File "/usr/local/lib/python3.6/dist-packages/pip/_vendor/pep517/_in_process.py", line 240, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/usr/local/lib/python3.6/dist-packages/pip/_vendor/pep517/_in_process.py", line 91, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/usr/local/lib/python3.6/dist-packages/setuptools/build_meta.py", line 148, in get_requires_for_build_wheel
      config_settings, requirements=['wheel'])
    File "/usr/local/lib/python3.6/dist-packages/setuptools/build_meta.py", line 128, in _get_build_requires
      self.run_setup()
    File "/usr/local/lib/python3.6/dist-packages/setuptools/build_meta.py", line 250, in run_setup
      self).run_setup(setup_script=setup_script)
    File "/usr/local/lib/python3.6/dist-packages/setuptools/build_meta.py", line 143, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 146, in <module>
      exec(compile(open(SALT_VERSION).read(), SALT_VERSION, "exec"))
    File "/tmp/pip-req-build-97jmi08l/salt/version.py", line 11, in <module>
      from distro import linux_distribution
  ModuleNotFoundError: No module named 'distro'
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python /usr/local/lib/python3.6/dist-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpvcz4rv_u Check the logs for full command output.
WARNING: You are using pip version 20.0.2; however, version 20.1 is available.
You should consider upgrading via the '/usr/bin/python -m pip install --upgrade pip' command.

I tried duplicate with Python 3.5.2 , Python 3.8.2
It works.

vagrant@ubuntu-groovy:~$ pip3 install salt
Collecting salt
  Downloading salt-3000.2.tar.gz (15.2 MB)
     |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 15.2 MB 2.9 MB/s 
Requirement already satisfied: Jinja2 in /usr/lib/python3/dist-packages (from salt) (2.10.1)
Requirement already satisfied: MarkupSafe in /usr/lib/python3/dist-packages (from salt) (1.1.1)
Requirement already satisfied: PyYAML in /usr/lib/python3/dist-packages (from salt) (5.3.1)
Collecting msgpack!=0.5.5,<1.0.0,>=0.5
  Downloading msgpack-0.6.2.tar.gz (119 kB)
     |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 119 kB 29.7 MB/s 
Collecting pycrypto>=2.6.1
  Downloading pycrypto-2.6.1.tar.gz (446 kB)
     |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 446 kB 2.9 MB/s 
Collecting pyzmq>=2.2.0
  Downloading pyzmq-19.0.1-cp38-cp38-manylinux1_x86_64.whl (1.1 MB)
     |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 1.1 MB 3.4 MB/s 
Requirement already satisfied: requests>=1.0.0 in /usr/lib/python3/dist-packages (from salt) (2.22.0)
Building wheels for collected packages: salt, msgpack, pycrypto
  Building wheel for salt (setup.py) ... done
  Created wheel for salt: filename=salt-3000.2-py3-none-any.whl size=9361595 sha256=32f23f468cd999d2366d73a42ce3dbc97dd3689f2fe9b5980920fe726850bf49
  Stored in directory: /home/vagrant/.cache/pip/wheels/7b/1a/ab/87eccb01b752ac97e52eb286a0bc9d55e9719fb820d51809b1
  Building wheel for msgpack (setup.py) ... done
  Created wheel for msgpack: filename=msgpack-0.6.2-cp38-cp38-linux_x86_64.whl size=341601 sha256=6b8bd708330590f2c444fc9230d27eae1675e0e052ae4662547da85970381b06
  Stored in directory: /home/vagrant/.cache/pip/wheels/5d/f2/04/0d19c10080b996bef17c908a6243e6e65d8da1a4094a3f604d
  Building wheel for pycrypto (setup.py) ... done
  Created wheel for pycrypto: filename=pycrypto-2.6.1-cp38-cp38-linux_x86_64.whl size=498371 sha256=8f0e1492eafe7ae5b8206bcb08208af2152c22dc36b1425bf770da47284a5cea
  Stored in directory: /home/vagrant/.cache/pip/wheels/d0/99/d0/0298ea019d63f1d63a0965b9944b719e875f9bd6ffc6dcf293
Successfully built salt msgpack pycrypto
Installing collected packages: msgpack, pycrypto, pyzmq, salt
  WARNING: The scripts salt, salt-api, salt-call, salt-cloud, salt-cp, salt-key, salt-master, salt-minion, salt-run, salt-ssh, salt-syndic, salt-unity and spm are installed in '/home/vagrant/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed msgpack-0.6.2 pycrypto-2.6.1 pyzmq-19.0.1 salt-3000.2
vagrant@ubuntu-groovy:~$ una
unalias              uname                unattended-upgrade   unattended-upgrades  
vagrant@ubuntu-groovy:~$ uname -a
Linux ubuntu-groovy 5.4.0-26-generic #30-Ubuntu SMP Mon Apr 20 16:58:30 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
vagrant@ubuntu-groovy:~$ python3 --version
Python 3.8.2
Was this page helpful?
0 / 5 - 0 ratings