Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't I build wheel for libsass even though it will install?

When I try to install libsass into a Python 3.5 virtualenv on Ubuntu, I get an error about not being able to build the wheel, but the install still seems to succeed. How do I either a) make the wheel build successfully so I can cache it for new virtualenvs or b) make it skip the compilation thingie that seems to be failing?

Here's a sample reproduction of the problem:

(libsass_test)$ pip install libsass
Collecting libsass
  Using cached libsass-0.9.3.tar.gz
Collecting six (from libsass)
  Using cached six-1.10.0-py2.py3-none-any.whl
Building wheels for collected packages: libsass
  Running setup.py bdist_wheel for libsass
  Complete output from command /home/cjohnson/libsass_test/bin/python3.5 -c "import setuptools;__file__='/tmp/pip-build-k8_g3p3v/libsass/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmp4q_j26e6pip-wheel-:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.5
  copying sass.py -> build/lib.linux-x86_64-3.5
  copying sassc.py -> build/lib.linux-x86_64-3.5
  copying sasstests.py -> build/lib.linux-x86_64-3.5
  creating build/lib.linux-x86_64-3.5/sassutils
  copying sassutils/distutils.py -> build/lib.linux-x86_64-3.5/sassutils
  copying sassutils/__init__.py -> build/lib.linux-x86_64-3.5/sassutils
  copying sassutils/builder.py -> build/lib.linux-x86_64-3.5/sassutils
  copying sassutils/wsgi.py -> build/lib.linux-x86_64-3.5/sassutils
  running build_ext
  building '_sass' extension
  creating build/temp.linux-x86_64-3.5
  creating build/temp.linux-x86_64-3.5/libsass
  creating build/temp.linux-x86_64-3.5/libsass/src
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I./libsass/include -I/usr/include/python3.5m -I/home/cjohnson/libsass_test/include/python3.5m -c pysass.cpp -o build/temp.linux-x86_64-3.5/pysass.o -c -O3 -fPIC -std=c++0x -Wall -Wno-parentheses
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I./libsass/include -I/usr/include/python3.5m -I/home/cjohnson/libsass_test/include/python3.5m -c libsass/src/functions.cpp -o build/temp.linux-x86_64-3.5/libsass/src/functions.o -c -O3 -fPIC -std=c++0x -Wall -Wno-parentheses

Snip some warnings… I can put the full dump in a gist if it would help.

  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I./libsass/include -I/usr/include/python3.5m -I/home/cjohnson/libsass_test/include/python3.5m -c libsass/src/extend.cpp -o build/temp.linux-x86_64-3.5/libsass/src/extend.o -c -O3 -fPIC -std=c++0x -Wall -Wno-parentheses
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/pysass.o build/temp.linux-x86_64-3.5/libsass/src/functions.o build/temp.linux-x86_64-3.5/libsass/src/plugins.o build/temp.linux-x86_64-3.5/libsass/src/error_handling.o build/temp.linux-x86_64-3.5/libsass/src/node.o build/temp.linux-x86_64-3.5/libsass/src/source_map.o build/temp.linux-x86_64-3.5/libsass/src/remove_placeholders.o build/temp.linux-x86_64-3.5/libsass/src/constants.o build/temp.linux-x86_64-3.5/libsass/src/emitter.o build/temp.linux-x86_64-3.5/libsass/src/environment.o build/temp.linux-x86_64-3.5/libsass/src/utf8_string.o build/temp.linux-x86_64-3.5/libsass/src/inspect.o build/temp.linux-x86_64-3.5/libsass/src/file.o build/temp.linux-x86_64-3.5/libsass/src/sass_values.o build/temp.linux-x86_64-3.5/libsass/src/prelexer.o build/temp.linux-x86_64-3.5/libsass/src/to_value.o build/temp.linux-x86_64-3.5/libsass/src/cencode.o build/temp.linux-x86_64-3.5/libsass/src/listize.o build/temp.linux-x86_64-3.5/libsass/src/sass2scss.o build/temp.linux-x86_64-3.5/libsass/src/c99func.o build/temp.linux-x86_64-3.5/libsass/src/values.o build/temp.linux-x86_64-3.5/libsass/src/bind.o build/temp.linux-x86_64-3.5/libsass/src/to_string.o build/temp.linux-x86_64-3.5/libsass/src/context.o build/temp.linux-x86_64-3.5/libsass/src/eval.o build/temp.linux-x86_64-3.5/libsass/src/output.o build/temp.linux-x86_64-3.5/libsass/src/to_c.o build/temp.linux-x86_64-3.5/libsass/src/sass_functions.o build/temp.linux-x86_64-3.5/libsass/src/sass_util.o build/temp.linux-x86_64-3.5/libsass/src/parser.o build/temp.linux-x86_64-3.5/libsass/src/ast.o build/temp.linux-x86_64-3.5/libsass/src/memory_manager.o build/temp.linux-x86_64-3.5/libsass/src/json.o build/temp.linux-x86_64-3.5/libsass/src/util.o build/temp.linux-x86_64-3.5/libsass/src/lexer.o build/temp.linux-x86_64-3.5/libsass/src/position.o build/temp.linux-x86_64-3.5/libsass/src/cssize.o build/temp.linux-x86_64-3.5/libsass/src/units.o build/temp.linux-x86_64-3.5/libsass/src/sass_context.o build/temp.linux-x86_64-3.5/libsass/src/expand.o build/temp.linux-x86_64-3.5/libsass/src/sass_interface.o build/temp.linux-x86_64-3.5/libsass/src/sass.o build/temp.linux-x86_64-3.5/libsass/src/base64vlq.o build/temp.linux-x86_64-3.5/libsass/src/color_maps.o build/temp.linux-x86_64-3.5/libsass/src/extend.o -L./libsass/src -o build/lib.linux-x86_64-3.5/_sass.cpython-35m-x86_64-linux-gnu.so -fPIC -lstdc++
  running build_scripts
  creating build/scripts-3.5
  copying and adjusting sassc.py -> build/scripts-3.5
  changing mode of build/scripts-3.5/sassc.py from 664 to 775
  installing to build/bdist.linux-x86_64/wheel
  running install
  running install_lib
  creating build/bdist.linux-x86_64
  creating build/bdist.linux-x86_64/wheel
  copying build/lib.linux-x86_64-3.5/sassc.py -> build/bdist.linux-x86_64/wheel
  creating build/bdist.linux-x86_64/wheel/sassutils
  copying build/lib.linux-x86_64-3.5/sassutils/distutils.py -> build/bdist.linux-x86_64/wheel/sassutils
  copying build/lib.linux-x86_64-3.5/sassutils/__init__.py -> build/bdist.linux-x86_64/wheel/sassutils
  copying build/lib.linux-x86_64-3.5/sassutils/builder.py -> build/bdist.linux-x86_64/wheel/sassutils
  copying build/lib.linux-x86_64-3.5/sassutils/wsgi.py -> build/bdist.linux-x86_64/wheel/sassutils
  copying build/lib.linux-x86_64-3.5/_sass.cpython-35m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel
  copying build/lib.linux-x86_64-3.5/sasstests.py -> build/bdist.linux-x86_64/wheel
  copying build/lib.linux-x86_64-3.5/sass.py -> build/bdist.linux-x86_64/wheel
  running install_egg_info
  running egg_info
  writing top-level names to libsass.egg-info/top_level.txt
  writing libsass.egg-info/PKG-INFO
  writing requirements to libsass.egg-info/requires.txt
  writing dependency_links to libsass.egg-info/dependency_links.txt
  writing entry points to libsass.egg-info/entry_points.txt
  warning: manifest_maker: standard file '-c' not found

  reading manifest file 'libsass.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'libsass.egg-info/SOURCES.txt'
  Copying libsass.egg-info to build/bdist.linux-x86_64/wheel/libsass-0.9.3-py3.5.egg-info
  running install_scripts
  creating build/bdist.linux-x86_64/wheel/libsass-0.9.3.data
  creating build/bdist.linux-x86_64/wheel/libsass-0.9.3.data/scripts
  copying build/scripts-3.5/sassc.py -> build/bdist.linux-x86_64/wheel/libsass-0.9.3.data/scripts
  changing mode of build/bdist.linux-x86_64/wheel/libsass-0.9.3.data/scripts/sassc.py to 775
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-k8_g3p3v/libsass/setup.py", line 273, in <module>
      cmdclass={'upload_doc': upload_doc}
    File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/home/cjohnson/libsass_test/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 213, in run
      archive_basename = self.get_archive_basename()
    File "/home/cjohnson/libsass_test/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 161, in get_archive_basename
      impl_tag, abi_tag, plat_tag = self.get_tag()
    File "/home/cjohnson/libsass_test/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 155, in get_tag
      assert tag == supported_tags[0]
  AssertionError

  ----------------------------------------
  Failed building wheel for libsass
Failed to build libsass
Installing collected packages: six, libsass
  Running setup.py install for libsass
Successfully installed libsass-0.9.3 six-1.10.0
like image 508
Carl Avatar asked Dec 10 '15 18:12

Carl


1 Answers

The problem is that wheel < 0.25.0 is incompatible with Python 3.5 and pip binary distributions.

Here's the issue tracker about it: https://bitbucket.org/pypa/wheel/issues/146/wheel-building-fails-on-cpython-350b3

One tricky bit is that wheel needs to be upgraded before you install anything else, so you can't just say wheel==whatever in your requirements.txt.

(libsass_test)$ pip install --upgrade wheel

Collecting wheel
  Using cached wheel-0.26.0-py2.py3-none-any.whl
Installing collected packages: wheel
  Found existing installation: wheel 0.24.0
    Uninstalling wheel-0.24.0:
      Successfully uninstalled wheel-0.24.0
Successfully installed wheel-0.26.0

(libsass_test)$ pip install libsass

Collecting libsass
  Using cached libsass-0.9.3.tar.gz
Requirement already satisfied (use --upgrade to upgrade): six in ./lib/python3.5/site-packages (from libsass)
Building wheels for collected packages: libsass
  Running setup.py bdist_wheel for libsass
  Stored in directory: /home/cjohnson/.cache/pip/wheels/23/fa/f8/ff89658d6dd1abcd7bc6791f856bb36cc6e578a707f6b41d67
Successfully built libsass
Installing collected packages: libsass
Successfully installed libsass-0.9.3
like image 136
Carl Avatar answered Oct 24 '22 17:10

Carl