Missing gcc while install libsass in Alpine
See original GitHub issueIt doesn’t look like a bug. It’s just a request from a lazy dev :p (please forgive me my laziness)
Collecting libsass
Using cached https://files.pythonhosted.org/packages/9d/00/cee3eae997e9d423f874a5d45a05e62965d0bea1c83c7aa8e8f9f8bd5c79/libsass-0.16.1.tar.gz
Requirement already satisfied: six in /usr/lib/python3.6/site-packages (from libsass) (1.12.0)
Installing collected packages: libsass
Running setup.py install for libsass ... error
Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-djkeq6ms/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 /tmp/pip-record-cx43pg7n/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
copying pysassc.py -> build/lib.linux-x86_64-3.6
copying sass.py -> build/lib.linux-x86_64-3.6
copying sassc.py -> build/lib.linux-x86_64-3.6
copying sasstests.py -> build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/sassutils
copying sassutils/distutils.py -> build/lib.linux-x86_64-3.6/sassutils
copying sassutils/wsgi.py -> build/lib.linux-x86_64-3.6/sassutils
copying sassutils/_compat.py -> build/lib.linux-x86_64-3.6/sassutils
copying sassutils/builder.py -> build/lib.linux-x86_64-3.6/sassutils
copying sassutils/__init__.py -> build/lib.linux-x86_64-3.6/sassutils
running build_ext
building '_sass' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/libsass
creating build/temp.linux-x86_64-3.6/libsass/src
creating build/temp.linux-x86_64-3.6/libsass/src/memory
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -I./libsass/include -I/usr/include/python3.6m -c libsass/src/ast.cpp -o build/temp.linux-x86_64-3.6/libsass/src/ast.o -fPIC -std=gnu++0x -Wall -Wno-parentheses -Werror=switch -DLIBSASS_VERSION="3.5.5"
**unable to execute 'gcc': No such file or directory**
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-djkeq6ms/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 /tmp/pip-record-cx43pg7n/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-djkeq6ms/libsass/
I just want to make a lightweight docker image for my own purpose so I don’t intend to install gcc. I just wonder if we have a pre-compiled version for Alpine.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
libsass - Alpine Linux packages
Package, libsass. Version, 3.6.5-r0. Description, C/C++ implementation of a Sass compiler. Project, https://sass-lang.com/libsass.
Read more >docker, alpine, and matplotlib - python - Server Fault
I solved this issue by adding: RUN ln -s /usr/include/locale.h /usr/include/xlocale.h. Everything could install properly.
Read more >Macbook m1 node js docker image build failed - Stack Overflow
Try running it with linux/amd64. In your docker config change: FROM node:lts-alpine as build-stage. to. FROM --platform=linux/amd64 ...
Read more >Error when building image - Docker Community Forums
Hi all, I'm new to Docker and I have an Linux x86-64 image on Docker Hub that I would like to install on...
Read more >LibSass - Sass
Sass stands with the protesters against police violence. We encourage our users to get in the streets and join them if you can....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh thank you very much, doing as you advised, I’ve finally installed the lib. Now, please close this thread.
Conclusion
In Alpine, we need to install these packages before installing libsass-python:
apk add build-base
apk add python3-dev
Note, it will take a while to install lib, be patient.
you also need the headers for python, usually
python-dev
orpython-devel
or something of the sort