Skip to content

error: invalid command 'bdist_wheel' #348

Closed

Description

@andyyuan78

ub1404@ub1404-A:~/github/tensorflow$ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
Wed Nov 25 02:32:35 EST 2015 : === Using tmpdir: /tmp/tmp.lVOy4pRiQ5
/tmp/tmp.lVOy4pRiQ5 ~/github/tensorflow
Wed Nov 25 02:32:35 EST 2015 : === Building wheel
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'

Activity

  1. chenghuige commented on Nov 25, 2015

    @chenghuige

    pip install wheel

  2. andyyuan78 commented on Nov 25, 2015

    @andyyuan78
    Author

    ub1404@ub1404-A:~/github/tensorflow$ sudo pip install wheel
    [sudo] password for ub1404:
    The directory '/home/ub1404/.cache/pip/log' or its parent directory is not owned by the current user and the debug log has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want the -H flag.
    The directory '/home/ub1404/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want the -H flag.
    You are using pip version 6.0.8, however version 7.1.2 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    The directory '/home/ub1404/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want the -H flag.
    Collecting wheel
    Downloading wheel-0.26.0-py2.py3-none-any.whl (63kB)
    100% |################################| 65kB 837kB/s
    Installing collected packages: wheel

    Successfully installed wheel-0.26.0
    ub1404@ub1404-A:/github/tensorflow$
    ub1404@ub1404-A:
    /github/tensorflow$
    ub1404@ub1404-A:~/github/tensorflow$ sudo bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
    Wed Nov 25 03:06:54 EST 2015 : === Using tmpdir: /tmp/tmp.6aZe9fEjxd
    /tmp/tmp.6aZe9fEjxd ~/github/tensorflow
    Wed Nov 25 03:06:54 EST 2015 : === Building wheel
    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'
    ub1404@ub1404-A:~/github/tensorflow$

  3. andyyuan78 commented on Nov 25, 2015

    @andyyuan78
    Author

    pip install wheel can sovle this issue.

    I used pip2 install wheel since my installed both py2 and py3

  4. turbojava commented on Mar 15, 2017

    @turbojava

    I encountered the same problem and worked it out. It seems that python can't find wheel module.
    Does you use pyenv-virtualenv? you should install wheel on global python

    pyenv global 3.6.0
    pip3 install wheel
    
  5. pablote commented on Sep 13, 2017

    @pablote

    anyone still having this problem? I have wheel installed in both pip2 and pip3, still the command fails

    pablo@batman tensorflow (master) $ pip2 list
    DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
    certifi (2017.7.27.1)
    chardet (3.0.4)
    cryptop (0.1.0)
    idna (2.5)
    mercurial (4.3.1)
    numpy (1.13.1)
    pip (9.0.1)
    requests (2.18.2)
    setuptools (32.1.0)
    six (1.10.0)
    urllib3 (1.22)
    wheel (0.29.0)
    yasm (0.0)
    pablo@batman tensorflow (master) $ pip3 list
    DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
    pip (9.0.1)
    setuptools (32.2.0)
    virtualenv (15.1.0)
    wheel (0.29.0)
    pablo@batman tensorflow (master) $ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
    Tue Sep 12 21:52:39 -03 2017 : === Using tmpdir: /var/folders/p2/1n2xjbq93hn4sd7lgj9mv4c80000gn/T/tmp.XXXXXXXXXX.TBZdyy7q
    ~/Documents/work/projects/forks/tensorflow/bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles ~/Documents/work/projects/forks/tensorflow
    ~/Documents/work/projects/forks/tensorflow
    /var/folders/p2/1n2xjbq93hn4sd7lgj9mv4c80000gn/T/tmp.XXXXXXXXXX.TBZdyy7q ~/Documents/work/projects/forks/tensorflow
    Tue Sep 12 21:52:41 -03 2017 : === Building wheel
    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'
    
  6. matan1 commented on Dec 25, 2017

    @matan1

    I was having this problem and for me it was not sufficient to simply execute "sudo pip install wheel".

    To investigate further I looked into the bazel-bin/tensorflow/tools/pip_package/build_pip_package script to see how it was loading python, where I found these lines:

    # Before we leave the top-level directory, make sure we know how to
    # call python.
    source tools/python_bin_path.sh
    

    The shell script sourced there is the one liner:

    export PYTHON_BIN_PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin/python"

    Which is the python version I selected when configuring my tensorflow build.

    The pip on my path, however, was for python 3.5, which you can see by calling pip --version or which pip. So my calls to sudo pip install wheel were only installing to the 3.5 version. The solution for me was to explicitly call the version of pip for the version/install of python you are building tensorflow with. In my case, that was:

    sudo /Library/Frameworks/Python.framework/Versions/2.7/bin/pip install wheel

    After that, the build_pip_package script worked for me.

  7. esbolice commented on Jul 26, 2018

    @esbolice

    Maybe use sudo chown you_user_name /path/to/project/evn/* -R
    it was good for me!

  8. relh commented on Apr 27, 2020

    @relh

    if you're on ubuntu and it doesn't work, see this:

    https://stackoverflow.com/a/59596814/2353085

    sudo apt-get install gcc libpq-dev -y
    sudo apt-get install python-dev python-pip -y
    sudo apt-get install python3-dev python3-pip python3-venv python3-wheel -y
    pip3 install wheel

  9. romelgomez commented on May 30, 2020

    @romelgomez

    @relh

    I builded a script to have various environments in one project DEV, QA, etc, in each run, I delete the .temp folder, where is the venv for each environment, and I get the error error: invalid command 'bdist_wheel',  I realize that the error disappears if I don't delete the folder, but then I add the install pip3 install wheel before install the other libs and that resolved the problem too. 

    #!/bin/bash
    
    # Time tracker Start
    echo START: `date`
    
    # ..:: DEV
    
    ENVIRONMENT='dev'
    
    ENVIRONMENT_DIR="/${ENVIRONMENT}"
    
    ENVIRONMENTS_DIR="/.temp"
    
    PROJECT_DIR="/project"
    
    PWD="$(pwd)"
    
    # Define environment dependencies FOLDER
    VENV_DIR="${PWD}${ENVIRONMENTS_DIR}${ENVIRONMENT_DIR}"
    
    # Clear environment dependencies FOLDER
    if [ -d "$VENV_DIR" ]; then
        rm -rf $VENV_DIR
    fi
    
    # Create venv directory
    python3.6 -m venv $VENV_DIR
    
    # Activate venv directory
    .  .${ENVIRONMENTS_DIR}${ENVIRONMENT_DIR}/bin/activate
    
    # https://github.com/tensorflow/tensorflow/issues/348
    # Issue ref: https://stackoverflow.com/a/59596814/2513972
    pip3.6 install wheel
    
    # Install requirements
    pip3.6 install -r "requirements_${ENVIRONMENT}.txt"
    
    
    export PYTHONPATH="${PYTHONPATH}:${PWD}${PROJECT_DIR}"
    
    
    # Time tracker End
    echo END: `date`
    
    

    repo: https://github.com/romelgomez/python-project-with-various-environments-example

  10. added a commit that references this issue on May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions