databrickslabs / cicd-templates

Manage your Databricks deployments and CI with code.
Other
202 stars 100 forks source link

Build artifact task error: invalid command 'bdist_wheel' #16

Closed bweisberg closed 4 years ago

bweisberg commented 4 years ago

I'm running this pipeline in Azure DevOps. The Build Artifact task exits with code '1' and the error details

Script contents:
python setup.py bdist_wheel
========================== Starting Command Output ===========================
/bin/bash --noprofile --norc /home/vsts/work/_temp/9ca428f0-653f-47d8-8a33-6ef61518c30c.sh
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: invalid command 'bdist_wheel'

##[error]Bash exited with code '1'.

The earlier task Install Python Dependencies was succesful and appears to have installed wheel.

Collecting wheel
  Downloading wheel-0.34.2-py2.py3-none-any.whl (26 kB)
bweisberg commented 4 years ago

Actually there are some errors in the Install Python Dependencies task:

Collecting pip
  Downloading pip-20.2-py2.py3-none-any.whl (1.5 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.1.1
    Uninstalling pip-20.1.1:
      Successfully uninstalled pip-20.1.1
Successfully installed pip-20.2
Requirement already satisfied: setuptools in /opt/hostedtoolcache/Python/3.7.8/x64/lib/python3.7/site-packages (from -r requirements.txt (line 1)) (47.1.0)
Collecting wheel
  Downloading wheel-0.34.2-py2.py3-none-any.whl (26 kB)
Collecting pyspark==2.4.5
  Downloading pyspark-2.4.5.tar.gz (217.8 MB)
    ERROR: Command errored out with exit status 1:
     command: /opt/hostedtoolcache/Python/3.7.8/x64/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-npi3l0t3/pyspark/setup.py'"'"'; __file__='"'"'/tmp/pip-install-npi3l0t3/pyspark/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-pip-egg-info-amyoot_r
         cwd: /tmp/pip-install-npi3l0t3/pyspark/
    Complete output (47 lines):
    Could not import pypandoc - required to package PySpark
    WARNING: The wheel package is not available.
      ERROR: Command errored out with exit status 1:
       command: /opt/hostedtoolcache/Python/3.7.8/x64/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-nmiuu3b3/pypandoc/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-nmiuu3b3/pypandoc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-awpu9kq3
           cwd: /tmp/pip-wheel-nmiuu3b3/pypandoc/
      Complete output (8 lines):
      no pandoc found, building platform unspecific wheel...
      use 'python setup.py download_pandoc' to download pandoc.
      usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
         or: setup.py --help [cmd1 cmd2 ...]
         or: setup.py --help-commands
         or: setup.py cmd --help

      error: invalid command 'bdist_wheel'
      ----------------------------------------
      ERROR: Failed building wheel for pypandoc
    ERROR: Failed to build one or more wheels
    Traceback (most recent call last):
      File "/opt/hostedtoolcache/Python/3.7.8/x64/lib/python3.7/site-packages/setuptools/installer.py", line 128, in fetch_build_egg
bweisberg commented 4 years ago

Using a self-hosted agent with Ubuntu 18.04 and Python 3.7 I got further along. I had to add an pip install --ignore-installed flag, otherwise pyyaml 5.1 was not being installed.

kiranvasudev commented 4 years ago

@bweisberg I had a very similar issue, but on Github Actions. I changed how the requirements/dependencies are installed in the workflow file, and it solved the issue. What I changed was:

name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        python -m pip install --upgrade setuptools
        python -m pip install --upgrade pandoc
        python -m pip install --upgrade pypandoc
        pip install -r requirements.txt

Hope this helps !

mshtelma commented 4 years ago

@kiranvasudev Thanks! I have updated spark version to 3.0.0 and this has fixed this issue.

pythondevop12 commented 2 years ago

how did you resolved this error?

pythondevop12 commented 2 years ago

Actually there are some errors in the Install Python Dependencies task:

Collecting pip
  Downloading pip-20.2-py2.py3-none-any.whl (1.5 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.1.1
    Uninstalling pip-20.1.1:
      Successfully uninstalled pip-20.1.1
Successfully installed pip-20.2
Requirement already satisfied: setuptools in /opt/hostedtoolcache/Python/3.7.8/x64/lib/python3.7/site-packages (from -r requirements.txt (line 1)) (47.1.0)
Collecting wheel
  Downloading wheel-0.34.2-py2.py3-none-any.whl (26 kB)
Collecting pyspark==2.4.5
  Downloading pyspark-2.4.5.tar.gz (217.8 MB)
    ERROR: Command errored out with exit status 1:
     command: /opt/hostedtoolcache/Python/3.7.8/x64/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-npi3l0t3/pyspark/setup.py'"'"'; __file__='"'"'/tmp/pip-install-npi3l0t3/pyspark/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-pip-egg-info-amyoot_r
         cwd: /tmp/pip-install-npi3l0t3/pyspark/
    Complete output (47 lines):
    Could not import pypandoc - required to package PySpark
    WARNING: The wheel package is not available.
      ERROR: Command errored out with exit status 1:
       command: /opt/hostedtoolcache/Python/3.7.8/x64/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-nmiuu3b3/pypandoc/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-nmiuu3b3/pypandoc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-awpu9kq3
           cwd: /tmp/pip-wheel-nmiuu3b3/pypandoc/
      Complete output (8 lines):
      no pandoc found, building platform unspecific wheel...
      use 'python setup.py download_pandoc' to download pandoc.
      usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
         or: setup.py --help [cmd1 cmd2 ...]
         or: setup.py --help-commands
         or: setup.py cmd --help

      error: invalid command 'bdist_wheel'
      ----------------------------------------
      ERROR: Failed building wheel for pypandoc
    ERROR: Failed to build one or more wheels
    Traceback (most recent call last):
      File "/opt/hostedtoolcache/Python/3.7.8/x64/lib/python3.7/site-packages/setuptools/installer.py", line 128, in fetch_build_egg

how you resolve this?