question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build failed on MacOS(M1)

See original GitHub issue

Docker build failed on Mac M1

Steps to reproduce the behavior:

  1. Run ‘git clone https://github.com/heartexlabs/label-studio.git
  2. Run ‘docker-compose build’
  3. See error

Environment (please complete the following information):

  • OS: MacOS 11.2.3
  • Label Studio Version: 1.0.1
  • Docker version 20.10.6, build 370c289

Additional context

nginx uses an image, skipping
Building app
[+] Building 201.0s (12/14)
 => [internal] load build definition from Dockerfile                                                                                    0.0s
 => => transferring dockerfile: 1.10kB                                                                                                  0.0s
 => [internal] load .dockerignore                                                                                                       0.0s
 => => transferring context: 312B                                                                                                       0.0s
 => [internal] load metadata for docker.io/library/ubuntu:20.04                                                                         2.1s
 => [internal] load build context                                                                                                       1.0s
 => => transferring context: 39.19MB                                                                                                    1.0s
 => [ 1/10] FROM docker.io/library/ubuntu:20.04@sha256:cf31af331f38d1d7158470e095b132acd126a7180a54f263d386da88eb681d93                 0.0s
 => CACHED [ 2/10] WORKDIR /label-studio                                                                                                0.0s
 => [ 3/10] COPY deploy/requirements.txt /label-studio                                                                                  0.0s
 => [ 4/10] RUN ln -snf /usr/share/zoneinfo/Europe/Berlin /etc/localtime && echo Europe/Berlin > /etc/timezone                          0.2s
 => [ 5/10] RUN apt-get update && apt-get install -y build-essential postgresql-client python3.8 python3-pip python3.8-dev uwsgi  git  43.7s
 => [ 6/10] RUN chgrp -R 0 /var/log /var/cache /var/run /run /tmp /etc/uwsgi &&     chmod -R g+rwX /var/log /var/cache /var/run /run /  0.2s
 => [ 7/10] RUN pip3 install --upgrade pip                                                                                              2.7s
 => ERROR [ 8/10] RUN pip3 install -r requirements.txt && pip install uwsgi                                                           151.0s
------
 > [ 8/10] RUN pip3 install -r requirements.txt && pip install uwsgi:
#12 0.452 Requirement already satisfied: wheel in /usr/lib/python3/dist-packages (from -r requirements.txt (line 1)) (0.34.2)
#12 0.768 Collecting appdirs>=1.4.3
#12 1.170   Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
#12 1.303 Collecting attr==0.3.1
#12 1.401   Downloading attr-0.3.1.tar.gz (1.7 kB)
#12 1.609 Collecting attrs==19.1.0
#12 1.713   Downloading attrs-19.1.0-py2.py3-none-any.whl (35 kB)
#12 1.933 Collecting pyyaml>=5.3.1
#12 2.030   Downloading PyYAML-5.4.1-cp38-cp38-manylinux2014_aarch64.whl (818 kB)
#12 2.548 Collecting azure-storage-blob>=12.6.0
#12 2.654   Downloading azure_storage_blob-12.8.1-py2.py3-none-any.whl (345 kB)
#12 2.860 Collecting boto==2.49.0
#12 2.957   Downloading boto-2.49.0-py2.py3-none-any.whl (1.4 MB)
#12 3.673 Collecting boto3==1.16.28
#12 3.775   Downloading boto3-1.16.28-py2.py3-none-any.whl (129 kB)
#12 4.216 Collecting botocore==1.19.28
#12 4.321   Downloading botocore-1.19.28-py2.py3-none-any.whl (7.0 MB)
#12 6.205 Collecting google-cloud-storage==1.28.1
#12 6.300   Downloading google_cloud_storage-1.28.1-py2.py3-none-any.whl (80 kB)
#12 6.459 Collecting Django==3.1.4
#12 6.554   Downloading Django-3.1.4-py3-none-any.whl (7.8 MB)
#12 8.446 Collecting django_annoying==0.10.6
#12 8.565   Downloading django_annoying-0.10.6-py2.py3-none-any.whl (9.5 kB)
#12 8.676 Collecting django_debug_toolbar==3.2
#12 8.773   Downloading django_debug_toolbar-3.2-py3-none-any.whl (200 kB)
#12 8.918 Collecting django_filter==2.4.0
#12 9.017   Downloading django_filter-2.4.0-py3-none-any.whl (73 kB)
#12 9.145 Collecting django_model_utils==4.1.1
#12 9.242   Downloading django_model_utils-4.1.1-py3-none-any.whl (32 kB)
#12 9.362 Collecting django_rq==2.3.2
#12 9.467   Downloading django_rq-2.3.2-py2.py3-none-any.whl (45 kB)
#12 9.596 Collecting django-cors-headers==3.6.0
#12 9.694   Downloading django_cors_headers-3.6.0-py3-none-any.whl (12 kB)
#12 9.857 Collecting django-extensions==3.1.0
#12 9.954   Downloading django_extensions-3.1.0-py3-none-any.whl (222 kB)
#12 10.12 Collecting django-rest-swagger==2.2.0
#12 10.22   Downloading django_rest_swagger-2.2.0-py2.py3-none-any.whl (495 kB)
#12 10.45 Collecting django-user-agents==0.4.0
#12 10.54   Downloading django_user_agents-0.4.0-py3-none-any.whl (8.6 kB)
#12 10.66 Collecting django-redis-cache==3.0.0
#12 10.77   Downloading django-redis-cache-3.0.0.tar.gz (14 kB)
#12 10.99 Collecting drf_dynamic_fields==0.3.0
#12 11.08   Downloading drf_dynamic_fields-0.3.0-py2.py3-none-any.whl (6.6 kB)
#12 11.20 Collecting drf_yasg==1.20.0
#12 11.30   Downloading drf_yasg-1.20.0-py2.py3-none-any.whl (1.6 MB)
#12 11.79 Collecting drf-generators==0.3.0
#12 11.89   Downloading drf-generators-0.3.0.tar.gz (9.4 kB)
#12 12.13 Collecting label-studio-converter==0.0.28
#12 12.23   Downloading label_studio_converter-0.0.28-py3-none-any.whl (13 kB)
#12 12.35 Collecting htmlmin==0.1.12
#12 12.44   Downloading htmlmin-0.1.12.tar.gz (19 kB)
#12 12.64 Collecting jsonschema==3.2.0
#12 12.74   Downloading jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
#12 12.87 Collecting lockfile>=0.12.0
#12 12.96   Downloading lockfile-0.12.2-py2.py3-none-any.whl (13 kB)
#12 13.22 Collecting lxml>=4.2.5
#12 13.31   Downloading lxml-4.6.3-cp38-cp38-manylinux2014_aarch64.whl (7.3 MB)
#12 15.37 Collecting moto==1.3.16.dev122
#12 15.47   Downloading moto-1.3.16.dev122-py2.py3-none-any.whl (909 kB)
#12 15.98 Collecting numpy>=1.19.1
#12 16.08   Downloading numpy-1.20.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (12.7 MB)
#12 19.39 Collecting ordered_set==4.0.2
#12 19.49   Downloading ordered-set-4.0.2.tar.gz (10 kB)
#12 19.84 Collecting pandas>=0.24.0
#12 19.94   Downloading pandas-1.2.4.tar.gz (5.5 MB)
#12 21.92   Installing build dependencies: started
#12 87.03   Installing build dependencies: still running...
#12 104.2   Installing build dependencies: finished with status 'done'
#12 104.2   Getting requirements to build wheel: started
#12 149.3   Getting requirements to build wheel: finished with status 'done'
#12 149.3     Preparing wheel metadata: started
#12 149.7     Preparing wheel metadata: finished with status 'done'
#12 149.9 Collecting protobuf>=3.15.5
#12 150.0   Downloading protobuf-3.17.0-cp38-cp38-manylinux2014_aarch64.whl (925 kB)
#12 150.5 Collecting psycopg2-binary==2.8.4
#12 150.6   Downloading psycopg2-binary-2.8.4.tar.gz (378 kB)
#12 150.8     ERROR: Command errored out with exit status 1:
#12 150.8      command: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-xs253po3/psycopg2-binary_68e13ade3dc147fa81c6d99ea37114e8/setup.py'"'"'; __file__='"'"'/tmp/pip-install-xs253po3/psycopg2-binary_68e13ade3dc147fa81c6d99ea37114e8/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-2dvapv0v
#12 150.8          cwd: /tmp/pip-install-xs253po3/psycopg2-binary_68e13ade3dc147fa81c6d99ea37114e8/
#12 150.8     Complete output (23 lines):
#12 150.8     running egg_info
#12 150.8     creating /tmp/pip-pip-egg-info-2dvapv0v/psycopg2_binary.egg-info
#12 150.8     writing /tmp/pip-pip-egg-info-2dvapv0v/psycopg2_binary.egg-info/PKG-INFO
#12 150.8     writing dependency_links to /tmp/pip-pip-egg-info-2dvapv0v/psycopg2_binary.egg-info/dependency_links.txt
#12 150.8     writing top-level names to /tmp/pip-pip-egg-info-2dvapv0v/psycopg2_binary.egg-info/top_level.txt
#12 150.8     writing manifest file '/tmp/pip-pip-egg-info-2dvapv0v/psycopg2_binary.egg-info/SOURCES.txt'
#12 150.8
#12 150.8     Error: pg_config executable not found.
#12 150.8
#12 150.8     pg_config is required to build psycopg2 from source.  Please add the directory
#12 150.8     containing pg_config to the $PATH or specify the full executable path with the
#12 150.8     option:
#12 150.8
#12 150.8         python setup.py build_ext --pg-config /path/to/pg_config build ...
#12 150.8
#12 150.8     or with the pg_config option in 'setup.cfg'.
#12 150.8
#12 150.8     If you prefer to avoid building psycopg2 from source, please install the PyPI
#12 150.8     'psycopg2-binary' package instead.
#12 150.8
#12 150.8     For further information please check the 'doc/src/install.rst' file (also at
#12 150.8     <http://initd.org/psycopg/docs/install.html>).
#12 150.8
#12 150.8     ----------------------------------------
#12 150.8 WARNING: Discarding https://files.pythonhosted.org/packages/00/7b/a623f49b3248957e7eaaac52eba1117209775d54e7a8501c460473a7ba4f/psycopg2-binary-2.8.4.tar.gz#sha256=3a2522b1d9178575acee4adf8fd9f979f9c0449b00b4164bb63c3475ea6528ed (from https://pypi.org/simple/psycopg2-binary/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
#12 150.8 ERROR: Could not find a version that satisfies the requirement psycopg2-binary==2.8.4 (from versions: 2.7.4, 2.7.5, 2.7.6, 2.7.6.1, 2.7.7, 2.8, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.8.5, 2.8.6)
#12 150.8 ERROR: No matching distribution found for psycopg2-binary==2.8.4```

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
makseqcommented, May 17, 2021

@cogor Unfortunately we weren’t able to install LS on M1, Apple hasn’t yet supported a lot of libraries on M1. I can propose to try a docker: https://labelstud.io/guide/install.html#Install-with-Docker

0reactions
makseqcommented, Sep 22, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Solve React Native Build Failed on M1 Macbook Pro / Air
Solution to Run and Build React Native on M1 Macbook Pro · Set Terminal App to use Rosetta :. Select the app in...
Read more >
How to Solve React Native (IOS) Build Failed on Apple M1 Pro ...
Here is the solution to Run and Build React Native on M1 Macbook Pro · A- Install Rosetta · B- Before opening terminal...
Read more >
Build failed on MacBook Pro M1 · Issue #580 - GitHub
After researching for quite a long time I found out this error is caused of clang incompatibility on apple-m1. Task :buildJniLib FAILED
Read more >
Not Able to Build Some Versions of Python on M1 at 12.3.1
I trying to build older version of python such as 3.6, 3.7, 3.8 using pyenv and having build failures. I am on apple...
Read more >
dotnet build failed with zero errors and warnings on mac m1
I am having the same issue, seems to be a bug on .NET 7 RC1. As a workaround I'm doing the following: dotnet...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found