Skip to content

Instantly share code, notes, and snippets.

@tomfa
Last active March 27, 2020 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomfa/078ba88fa2c984001a9407e9e77ea717 to your computer and use it in GitHub Desktop.
Save tomfa/078ba88fa2c984001a9407e9e77ea717 to your computer and use it in GitHub Desktop.
pip install libsass fails for Python 3.8
mkdir test && cd test
echo "3.7.0" > .python-version
# Verify python 3.7 – do "pyenv install" if necessary
python --version
$(pyenv which python) -m venv .venv
source .venv/bin/activate
pip install --no-cache-dir libsass
# Collecting libsass
# Downloading https://files.pythonhosted.org/packages/66/0c/6c9194d0d1d84d56bee899d18bb9d940725e3d80cbc9048b00b5ff96afb1/libsass-0.19.4-cp37-cp37m-macosx_10_14_x86_64.whl (984kB)
# 100% |████████████████████████████████| 993kB 44.8MB/s
# Collecting six (from libsass)
# Downloading https://files.pythonhosted.org/packages/65/26/32b8464df2a97e6dd1b656ed26b2c194606c16fe163c695a992b36c11cdf/six-1.13.0-py2.py3-none-any.whl
# Installing collected packages: six, libsass
# Successfully installed libsass-0.19.4 six-1.13.0
# Cleanup Python 3.7
deactivate
rm -rf .venv
echo "3.8.0" > .python-version
# Verify python 3.8 – do "pyenv install" if necessary
python --version
$(pyenv which python) -m venv .venv
# Install libsass
source .venv/bin/activate
pip install --no-cache-dir libsass
"""
Collecting libsass
Downloading https://files.pythonhosted.org/packages/bb/46/1fcb3086f43ab1793fbd53966d092c1fb3dade8780ce15a96ad520bce4c6/libsass-0.19.4.tar.gz (315kB)
|████████████████████████████████| 317kB 3.0MB/s
Requirement already satisfied: six in ./.venv/lib/python3.8/site-packages (from libsass) (1.13.0)
Installing collected packages: libsass
Running setup.py install for libsass ... error
ERROR: Command errored out with exit status 1:
command: /Users/tomfa/repos/test/.venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xn/zmwql88j0dn950vjr80kqkm80000gn/T/pip-install-u8p6am7a/libsass/setup.py'"'"'; __file__='"'"'/private/var/folders/xn/zmwql88j0dn950vjr80kqkm80000gn/T/pip-install-u8p6am7a/libsass/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/xn/zmwql88j0dn950vjr80kqkm80000gn/T/pip-record-js3ogze5/install-record.txt --single-version-externally-managed --compile --install-headers /Users/tomfa/repos/test/.venv/include/site/python3.8/libsass
cwd: /private/var/folders/xn/zmwql88j0dn950vjr80kqkm80000gn/T/pip-install-u8p6am7a/libsass/
Complete output (88 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.8
copying pysassc.py -> build/lib.macosx-10.14-x86_64-3.8
copying sass.py -> build/lib.macosx-10.14-x86_64-3.8
copying sassc.py -> build/lib.macosx-10.14-x86_64-3.8
copying sasstests.py -> build/lib.macosx-10.14-x86_64-3.8
creating build/lib.macosx-10.14-x86_64-3.8/sassutils
copying sassutils/__init__.py -> build/lib.macosx-10.14-x86_64-3.8/sassutils
copying sassutils/builder.py -> build/lib.macosx-10.14-x86_64-3.8/sassutils
copying sassutils/_compat.py -> build/lib.macosx-10.14-x86_64-3.8/sassutils
copying sassutils/distutils.py -> build/lib.macosx-10.14-x86_64-3.8/sassutils
copying sassutils/wsgi.py -> build/lib.macosx-10.14-x86_64-3.8/sassutils
running build_ext
building '_sass' extension
creating build/temp.macosx-10.14-x86_64-3.8
creating build/temp.macosx-10.14-x86_64-3.8/libsass
creating build/temp.macosx-10.14-x86_64-3.8/libsass/src
creating build/temp.macosx-10.14-x86_64-3.8/libsass/src/memory
clang++ -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I./libsass/include -I/Users/tomfa/repos/test/.venv/include -I/usr/local/var/pyenv/versions/3.8.0/include/python3.8 -c libsass/src/ast.cpp -o build/temp.macosx-10.14-x86_64-3.8/libsass/src/ast.o -c -O3 -fPIC -std=gnu++0x -Wall -Wno-parentheses -Werror=switch -stdlib=libc++ -mmacosx-version-min=10.7 -DLIBSASS_VERSION="3.6.3"
In file included from libsass/src/ast.cpp:5:
In file included from libsass/src/ast.hpp:9:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/unordered_map:384:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/__hash_table:19:
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:313:9: error: no member named 'signbit' in the global namespace
using ::signbit;
~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:314:9: error: no member named 'fpclassify' in the global namespace
using ::fpclassify;
~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:315:9: error: no member named 'isfinite' in the global namespace; did you mean 'finite'?
using ::isfinite;
~~^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/math.h:749:12: note: 'finite' declared here
extern int finite(double)
^
In file included from libsass/src/ast.cpp:5:
In file included from libsass/src/ast.hpp:9:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/unordered_map:384:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/__hash_table:19:
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:316:9: error: no member named 'isinf' in the global namespace
using ::isinf;
~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:317:9: error: no member named 'isnan' in the global namespace
using ::isnan;
~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:318:9: error: no member named 'isnormal' in the global namespace
using ::isnormal;
~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:319:7: error: no member named 'isgreater' in the global namespace; did you mean '::std::greater'?
using ::isgreater;
^~
/Library/Developer/CommandLineTools/usr/include/c++/v1/functional:720:29: note: '::std::greater' declared here
struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
^
In file included from libsass/src/ast.cpp:5:
In file included from libsass/src/ast.hpp:9:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/unordered_map:384:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/__hash_table:19:
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:320:7: error: no member named 'isgreaterequal' in the global namespace; did you mean '::std::greater_equal'?
using ::isgreaterequal;
^~
/Library/Developer/CommandLineTools/usr/include/c++/v1/functional:749:29: note: '::std::greater_equal' declared here
struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
^
In file included from libsass/src/ast.cpp:5:
In file included from libsass/src/ast.hpp:9:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/unordered_map:384:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/__hash_table:19:
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:321:9: error: no member named 'isless' in the global namespace
using ::isless;
~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:322:9: error: no member named 'islessequal' in the global namespace
using ::islessequal;
~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:323:9: error: no member named 'islessgreater' in the global namespace
using ::islessgreater;
~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:324:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:325:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
13 errors generated.
error: command 'clang++' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/tomfa/repos/test/.venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xn/zmwql88j0dn950vjr80kqkm80000gn/T/pip-install-u8p6am7a/libsass/setup.py'"'"'; __file__='"'"'/private/var/folders/xn/zmwql88j0dn950vjr80kqkm80000gn/T/pip-install-u8p6am7a/libsass/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/xn/zmwql88j0dn950vjr80kqkm80000gn/T/pip-record-js3ogze5/install-record.txt --single-version-externally-managed --compile --install-headers /Users/tomfa/repos/test/.venv/include/site/python3.8/libsass Check the logs for full command output.
"""
@tomfa
Copy link
Author

tomfa commented Mar 27, 2020

I solved this by attempting to run brew link openssl, then following the instructions:

Warning: Refusing to link macOS-provided software: openssl@1.1
If you need to have openssl@1.1 first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc

For compilers to find openssl@1.1 you may need to set:
  export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
  export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"

For pkg-config to find openssl@1.1 you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment