Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker image build failed psutil #238

Closed
JK87iab opened this issue Feb 26, 2020 · 5 comments
Closed

Docker image build failed psutil #238

JK87iab opened this issue Feb 26, 2020 · 5 comments

Comments

@JK87iab
Copy link

JK87iab commented Feb 26, 2020

Hi,
trying to use dask-kubernetes on azure. Building the image fails because it cant build the wheel for psutil.

output: Sending build context to Docker daemon  107.4MB

Step 1/5 : FROM mcr.microsoft.com/azure-functions/python:2.0-python3.7
 ---> 4b51b78aab24
Step 2/5 : ENV AzureWebJobsScriptRoot=/home/site/wwwroot     AzureFunctionsJobHost__Logging__Console__IsEnabled=true
 ---> Using cache
 ---> eb534c27d28a
Step 3/5 : COPY requirements.txt /
 ---> 322302ddc925
Step 4/5 : RUN pip install -r /requirements.txt
 ---> Running in c317344074b7
Collecting azure-functions
  Downloading https://files.pythonhosted.org/packages/ee/5f/280ff070b791bf0af3ca186e05001e42c42aaf8a342c3ad6c765d6f8471f/azure_functions-1.1.0-py3-none-any.whl (111kB)
Collecting psutil
  Downloading https://files.pythonhosted.org/packages/c4/b8/3512f0e93e0db23a71d82485ba256071ebef99b227351f0f5540f744af41/psutil-5.7.0.tar.gz (449kB)
Collecting dask-kubernetes
  Downloading https://files.pythonhosted.org/packages/b5/2b/187dd293b481addab2863c555dfcb4ede177823217cefb15dc3a88d57886/dask_kubernetes-0.10.1-py3-none-any.whl
Collecting distributed>=2.5.2
  Downloading https://files.pythonhosted.org/packages/26/99/054a5d1909bf12347e38b9995e5ee555417f8e264678ccebe4d51fb26637/distributed-2.11.0-py3-none-any.whl (595kB)
Collecting kubernetes>=9
  Downloading https://files.pythonhosted.org/packages/6e/fc/2cab119f679648b348b8940de0dd744a1f0ee99c690aa2ef6072f050816c/kubernetes-10.0.1-py2.py3-none-any.whl (1.5MB)
Collecting dask>=2.5.2
  Downloading https://files.pythonhosted.org/packages/c2/7a/22ffaff40b7c912cac6956e18d38c686b6b5756179e9c09e8e6bf7810aad/dask-2.11.0-py3-none-any.whl (785kB)
Collecting kubernetes-asyncio>=9
  Downloading https://files.pythonhosted.org/packages/31/44/dff4ea3e56c3a0d7599823a6a1dbbcd59e7dec8b288f78d965c2cbc8b0f0/kubernetes_asyncio-10.0.1.tar.gz (682kB)
Collecting sortedcontainers!=2.0.0,!=2.0.1
  Downloading https://files.pythonhosted.org/packages/13/f3/cf85f7c3a2dbd1a515d51e1f1676d971abe41bba6f4ab5443240d9a78e5b/sortedcontainers-2.1.0-py2.py3-none-any.whl
Collecting msgpack>=0.6.0
  Downloading https://files.pythonhosted.org/packages/d2/9f/5a6805e7e745531da7acc882f9ba4550ffd7d6f05a668a22b385f52741ee/msgpack-1.0.0-cp37-cp37m-manylinux1_x86_64.whl (275kB)
Requirement already satisfied: setuptools in /usr/local/lib/python3.7/site-packages (from distributed>=2.5.2->dask-kubernetes->-r /requirements.txt (line 3)) (44.0.0)
Collecting click>=6.6
  Downloading https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl (81kB)
Collecting cloudpickle>=0.2.2
  Downloading https://files.pythonhosted.org/packages/ea/0b/189cd3c19faf362ff2df5f301456c6cf8571ef6684644cfdfdbff293825c/cloudpickle-1.3.0-py2.py3-none-any.whl
Collecting zict>=0.1.3
  Downloading https://files.pythonhosted.org/packages/64/b4/a904be4184814adb9dfc2e679c4e611392080a32726a657a34cab93b38c2/zict-1.0.0-py2.py3-none-any.whl
Collecting pyyaml
  Downloading https://files.pythonhosted.org/packages/3d/d9/ea9816aea31beeadccd03f1f8b625ecf8f645bd66744484d162d84803ce5/PyYAML-5.3.tar.gz (268kB)
Collecting tornado>=5; python_version < "3.8"
  Downloading https://files.pythonhosted.org/packages/30/78/2d2823598496127b21423baffaa186b668f73cd91887fcef78b6eade136b/tornado-6.0.3.tar.gz (482kB)
Collecting toolz>=0.7.4
  Downloading https://files.pythonhosted.org/packages/22/8e/037b9ba5c6a5739ef0dcde60578c64d49f45f64c5e5e886531bfbc39157f/toolz-0.10.0.tar.gz (49kB)
Collecting tblib>=1.6.0
  Downloading https://files.pythonhosted.org/packages/0d/de/dca3e651ca62e59c08d324f4a51467fa4b8cbeaafb883b5e83720b4d4a47/tblib-1.6.0-py2.py3-none-any.whl
Collecting google-auth>=1.0.1
  Downloading https://files.pythonhosted.org/packages/5a/8d/e2ebbd0502627ed0d8a408162020e1c0792f088b49fddeedaaeebc206ed7/google_auth-1.11.2-py2.py3-none-any.whl (76kB)
Collecting requests-oauthlib
  Downloading https://files.pythonhosted.org/packages/a3/12/b92740d845ab62ea4edf04d2f4164d82532b5a0b03836d4d4e71c6f3d379/requests_oauthlib-1.3.0-py2.py3-none-any.whl
Collecting requests
  Downloading https://files.pythonhosted.org/packages/1a/70/1935c770cb3be6e3a8b78ced23d7e0f3b187f5cbfab4749523ed65d7c9b1/requests-2.23.0-py2.py3-none-any.whl (58kB)
Collecting python-dateutil>=2.5.3
  Downloading https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl (227kB)
Collecting certifi>=14.05.14
  Downloading https://files.pythonhosted.org/packages/b9/63/df50cac98ea0d5b006c55a399c3bf1db9da7b5a24de7890bc9cfd5dd9e99/certifi-2019.11.28-py2.py3-none-any.whl (156kB)
Collecting urllib3>=1.24.2
  Downloading https://files.pythonhosted.org/packages/e8/74/6e4f91745020f967d09332bb2b8b9b10090957334692eb88ea4afe91b77f/urllib3-1.25.8-py2.py3-none-any.whl (125kB)
Collecting six>=1.9.0
  Downloading https://files.pythonhosted.org/packages/65/eb/1f97cb97bfc2390a276969c6fae16075da282f5058082d4cb10c6c5c1dba/six-1.14.0-py2.py3-none-any.whl
Collecting websocket-client!=0.40.0,!=0.41.*,!=0.42.*,>=0.32.0
  Downloading https://files.pythonhosted.org/packages/4c/5f/f61b420143ed1c8dc69f9eaec5ff1ac36109d52c80de49d66e0c36c3dfdf/websocket_client-0.57.0-py2.py3-none-any.whl (200kB)
Collecting aiohttp>=2.3.10
  Downloading https://files.pythonhosted.org/packages/e3/71/6000eacb8923d9fd07aa8784a8fab4f022ae697f3c2456d7dca75c743dd6/aiohttp-3.6.2-cp37-cp37m-manylinux1_x86_64.whl (1.2MB)
Collecting heapdict
  Downloading https://files.pythonhosted.org/packages/b6/9d/cd4777dbcf3bef9d9627e0fe4bc43d2e294b1baeb01d0422399d5e9de319/HeapDict-1.0.1-py3-none-any.whl
Collecting rsa<4.1,>=3.1.4
  Downloading https://files.pythonhosted.org/packages/02/e5/38518af393f7c214357079ce67a317307936896e961e35450b70fad2a9cf/rsa-4.0-py2.py3-none-any.whl
Collecting pyasn1-modules>=0.2.1
  Downloading https://files.pythonhosted.org/packages/95/de/214830a981892a3e286c3794f41ae67a4495df1108c3da8a9f62159b9a9d/pyasn1_modules-0.2.8-py2.py3-none-any.whl (155kB)
Collecting cachetools<5.0,>=2.0.0
  Downloading https://files.pythonhosted.org/packages/08/6a/abf83cb951617793fd49c98cb9456860f5df66ff89883c8660aa0672d425/cachetools-4.0.0-py3-none-any.whl
Collecting oauthlib>=3.0.0
  Downloading https://files.pythonhosted.org/packages/05/57/ce2e7a8fa7c0afb54a0581b14a65b56e62b5759dbc98e80627142b8a3704/oauthlib-3.1.0-py2.py3-none-any.whl (147kB)
Collecting idna<3,>=2.5
  Downloading https://files.pythonhosted.org/packages/89/e3/afebe61c546d18fb1709a61bee788254b40e736cff7271c7de5de2dc4128/idna-2.9-py2.py3-none-any.whl (58kB)
Collecting chardet<4,>=3.0.2
  Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
Collecting multidict<5.0,>=4.5
  Downloading https://files.pythonhosted.org/packages/98/3f/e53dea9face4115abfb796f398bf74747a0d294537b12935d1bbf697c11a/multidict-4.7.5-cp37-cp37m-manylinux1_x86_64.whl (149kB)
Collecting attrs>=17.3.0
  Downloading https://files.pythonhosted.org/packages/a2/db/4313ab3be961f7a763066401fb77f7748373b6094076ae2bda2806988af6/attrs-19.3.0-py2.py3-none-any.whl
Collecting async-timeout<4.0,>=3.0
  Downloading https://files.pythonhosted.org/packages/e1/1e/5a4441be21b0726c4464f3f23c8b19628372f606755a9d2e46c187e65ec4/async_timeout-3.0.1-py3-none-any.whl
Collecting yarl<2.0,>=1.0
  Downloading https://files.pythonhosted.org/packages/70/54/7cb8eabe7dea1b441a7487ae3a1adb319f2d2e44a062a669f730a24dc474/yarl-1.4.2-cp37-cp37m-manylinux1_x86_64.whl (256kB)
Collecting pyasn1>=0.1.3
  Downloading https://files.pythonhosted.org/packages/62/1e/a94a8d635fa3ce4cfc7f506003548d0a2447ae76fd5ca53932970fe3053f/pyasn1-0.4.8-py2.py3-none-any.whl (77kB)
Building wheels for collected packages: psutil, kubernetes-asyncio, pyyaml, tornado, toolz
  Building wheel for psutil (setup.py): started
  Building wheel for psutil (setup.py): finished with status 'error'
?[91m  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6sx_tmbb/psutil/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6sx_tmbb/psutil/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-7w_gemb_ --python-tag cp37
       cwd: /tmp/pip-install-6sx_tmbb/psutil/
  Complete output (112 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/psutil
  copying psutil/_psposix.py -> build/lib.linux-x86_64-3.7/psutil
  copying psutil/_psaix.py -> build/lib.linux-x86_64-3.7/psutil
  copying psutil/_psosx.py -> build/lib.linux-x86_64-3.7/psutil
  copying psutil/_pslinux.py -> build/lib.linux-x86_64-3.7/psutil
  copying psutil/_psbsd.py -> build/lib.linux-x86_64-3.7/psutil
  copying psutil/_common.py -> build/lib.linux-x86_64-3.7/psutil
  copying psutil/__init__.py -> build/lib.linux-x86_64-3.7/psutil
  copying psutil/_pssunos.py -> build/lib.linux-x86_64-3.7/psutil
  copying psutil/_pswindows.py -> build/lib.linux-x86_64-3.7/psutil
  copying psutil/_compat.py -> build/lib.linux-x86_64-3.7/psutil
  creating build/lib.linux-x86_64-3.7/psutil/tests
  copying psutil/tests/test_memory_leaks.py -> build/lib.linux-x86_64-3.7/psutil/tests
  copying psutil/tests/test_contracts.py -> build/lib.linux-x86_64-3.7/psutil/tests
  copying psutil/tests/__main__.py -> build/lib.linux-x86_64-3.7/psutil/tests
  copying psutil/tests/runner.py -> build/lib.linux-x86_64-3.7/psutil/tests
  copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-3.7/psutil/tests
  copying psutil/tests/test_connections.py -> build/lib.linux-x86_64-3.7/psutil/tests
  copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-3.7/psutil/tests
  copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-3.7/psutil/tests
  copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-3.7/psutil/tests
  copying psutil/tests/test_unicode.py -> build/lib.linux-x86_64-3.7/psutil/tests
  copying psutil/tests/test_process.py -> build/lib.linux-x86_64-3.7/psutil/tests
  copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-3.7/psutil/tests
  copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-3.7/psutil/tests
  copying psutil/tests/__init__.py -> build/lib.linux-x86_64-3.7/psutil/tests
  copying psutil/tests/test_aix.py -> build/lib.linux-x86_64-3.7/psutil/tests
  copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-3.7/psutil/tests
  copying psutil/tests/test_system.py -> build/lib.linux-x86_64-3.7/psutil/tests
  running build_ext
  building 'psutil._psutil_linux' extension
  creating build/temp.linux-x86_64-3.7
  creating build/temp.linux-x86_64-3.7/psutil
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=570 -DPSUTIL_LINUX=1 -DPSUTIL_ETHTOOL_MISSING_TYPES=1 -I/usr/local/include/python3.7m -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.7/psutil/_psutil_common.o
  unable to execute 'gcc': No such file or directory
  Traceback (most recent call last):
    File "/usr/local/lib/python3.7/distutils/unixccompiler.py", line 118, in _compile
      extra_postargs)
    File "/usr/local/lib/python3.7/distutils/ccompiler.py", line 910, in spawn
      spawn(cmd, dry_run=self.dry_run)
    File "/usr/local/lib/python3.7/distutils/spawn.py", line 36, in spawn
      _spawn_posix(cmd, search_path, dry_run=dry_run)
    File "/usr/local/lib/python3.7/distutils/spawn.py", line 159, in _spawn_posix
      % (cmd, exit_status))
  distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/usr/local/lib/python3.7/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/lib/python3.7/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 192, in run
      self.run_command('build')
    File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.7/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 84, in run
      _build_ext.run(self)
    File "/usr/local/lib/python3.7/distutils/command/build_ext.py", line 340, in run
      self.build_extensions()
    File "/usr/local/lib/python3.7/distutils/command/build_ext.py", line 449, in build_extensions
      self._build_extensions_serial()
    File "/usr/local/lib/python3.7/distutils/command/build_ext.py", line 474, in _build_extensions_serial
      self.build_extension(ext)
    File "/usr/local/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 205, in build_extension
      _build_ext.build_extension(self, ext)
    File "/usr/local/lib/python3.7/distutils/command/build_ext.py", line 534, in build_extension
      depends=ext.depends)
    File "/usr/local/lib/python3.7/distutils/ccompiler.py", line 574, in compile
      self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
    File "/usr/local/lib/python3.7/distutils/unixccompiler.py", line 120, in _compile
      raise CompileError(msg)
  distutils.errors.CompileError: command 'gcc' failed with exit status 1
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/tmp/pip-install-6sx_tmbb/psutil/setup.py", line 393, in main
      setup(**kwargs)
    File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "/usr/local/lib/python3.7/distutils/core.py", line 163, in setup
      raise SystemExit("error: " + str(msg))
  SystemExit: error: command 'gcc' failed with exit status 1
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-6sx_tmbb/psutil/setup.py", line 426, in <module>
      main()
    File "/tmp/pip-install-6sx_tmbb/psutil/setup.py", line 400, in main
      missdeps("sudo apt-get install gcc python%s-dev" % py3)
    File "/tmp/pip-install-6sx_tmbb/psutil/setup.py", line 116, in missdeps
      s = hilite("C compiler or Python headers are not installed ", ok=False)
  TypeError: hilite() got an unexpected keyword argument 'ok'
  ----------------------------------------
?[0m?[91m  ERROR: Failed building wheel for psutil
?[0m  Running setup.py clean for psutil
  Building wheel for kubernetes-asyncio (setup.py): started
  Building wheel for kubernetes-asyncio (setup.py): finished with status 'done'
  Created wheel for kubernetes-asyncio: filename=kubernetes_asyncio-10.0.1-cp37-none-any.whl size=1496462 sha256=4437806b833f03a6a7cba4d1d22c493c0182efb5bd784fe66132f23b3bd7f76b
  Stored in directory: /home/.cache/pip/wheels/d7/0d/b4/339b0fb5d18cab8cd3ed024bac8f7007508471ba52cae761f1
  Building wheel for pyyaml (setup.py): started
  Building wheel for pyyaml (setup.py): finished with status 'done'
  Created wheel for pyyaml: filename=PyYAML-5.3-cp37-cp37m-linux_x86_64.whl size=44228 sha256=cb27df3b966235180e5069708aab6ece2313e20265aa4cfdf0348503f474129f
  Stored in directory: /home/.cache/pip/wheels/e4/76/4d/a95b8dd7b452b69e8ed4f68b69e1b55e12c9c9624dd962b191
  Building wheel for tornado (setup.py): started
  Building wheel for tornado (setup.py): finished with status 'done'
  Created wheel for tornado: filename=tornado-6.0.3-cp37-cp37m-linux_x86_64.whl size=410711 sha256=a977991a9a9c5d23bb9afaa758120ee720762d2cb7ec1067142ed5f7e37e3fed
  Stored in directory: /home/.cache/pip/wheels/84/bf/40/2f6ef700f48401ca40e5e3dd7d0e3c0a90e064897b7fe5fc08
  Building wheel for toolz (setup.py): started
  Building wheel for toolz (setup.py): finished with status 'done'
  Created wheel for toolz: filename=toolz-0.10.0-cp37-none-any.whl size=55577 sha256=27eb7a3a0801e19988dc608e121f55066d0708e83827b82de8a7d48c8fd91570
  Stored in directory: /home/.cache/pip/wheels/e1/8b/65/3294e5b727440250bda09e8c0153b7ba19d328f661605cb151
Successfully built kubernetes-asyncio pyyaml tornado toolz
Failed to build psutil
Installing collected packages: azure-functions, psutil, dask, sortedcontainers, msgpack, click, cloudpickle, heapdict, zict, pyyaml, tornado, toolz, tblib, distributed, pyasn1, rsa, pyasn1-modules, cachetools, six, google-auth, certifi, idna, chardet, urllib3, requests, oauthlib, requests-oauthlib, python-dateutil, websocket-client, kubernetes, multidict, attrs, async-timeout, yarl, aiohttp, kubernetes-asyncio, dask-kubernetes
    Running setup.py install for psutil: started
    Running setup.py install for psutil: finished with status 'error'
?[91m    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6sx_tmbb/psutil/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6sx_tmbb/psutil/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-8s1q36_o/install-record.txt --single-version-externally-managed --compile
         cwd: /tmp/pip-install-6sx_tmbb/psutil/
    Complete output (114 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/psutil
    copying psutil/_psposix.py -> build/lib.linux-x86_64-3.7/psutil
    copying psutil/_psaix.py -> build/lib.linux-x86_64-3.7/psutil
    copying psutil/_psosx.py -> build/lib.linux-x86_64-3.7/psutil
    copying psutil/_pslinux.py -> build/lib.linux-x86_64-3.7/psutil
    copying psutil/_psbsd.py -> build/lib.linux-x86_64-3.7/psutil
    copying psutil/_common.py -> build/lib.linux-x86_64-3.7/psutil
    copying psutil/__init__.py -> build/lib.linux-x86_64-3.7/psutil
    copying psutil/_pssunos.py -> build/lib.linux-x86_64-3.7/psutil
    copying psutil/_pswindows.py -> build/lib.linux-x86_64-3.7/psutil
    copying psutil/_compat.py -> build/lib.linux-x86_64-3.7/psutil
    creating build/lib.linux-x86_64-3.7/psutil/tests
    copying psutil/tests/test_memory_leaks.py -> build/lib.linux-x86_64-3.7/psutil/tests
    copying psutil/tests/test_contracts.py -> build/lib.linux-x86_64-3.7/psutil/tests
    copying psutil/tests/__main__.py -> build/lib.linux-x86_64-3.7/psutil/tests
    copying psutil/tests/runner.py -> build/lib.linux-x86_64-3.7/psutil/tests
    copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-3.7/psutil/tests
    copying psutil/tests/test_connections.py -> build/lib.linux-x86_64-3.7/psutil/tests
    copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-3.7/psutil/tests
    copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-3.7/psutil/tests
    copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-3.7/psutil/tests
    copying psutil/tests/test_unicode.py -> build/lib.linux-x86_64-3.7/psutil/tests
    copying psutil/tests/test_process.py -> build/lib.linux-x86_64-3.7/psutil/tests
    copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-3.7/psutil/tests
    copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-3.7/psutil/tests
    copying psutil/tests/__init__.py -> build/lib.linux-x86_64-3.7/psutil/tests
    copying psutil/tests/test_aix.py -> build/lib.linux-x86_64-3.7/psutil/tests
    copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-3.7/psutil/tests
    copying psutil/tests/test_system.py -> build/lib.linux-x86_64-3.7/psutil/tests
    running build_ext
    building 'psutil._psutil_linux' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/psutil
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=570 -DPSUTIL_LINUX=1 -DPSUTIL_ETHTOOL_MISSING_TYPES=1 -I/usr/local/include/python3.7m -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.7/psutil/_psutil_common.o
    unable to execute 'gcc': No such file or directory
    Traceback (most recent call last):
      File "/usr/local/lib/python3.7/distutils/unixccompiler.py", line 118, in _compile
        extra_postargs)
      File "/usr/local/lib/python3.7/distutils/ccompiler.py", line 910, in spawn
        spawn(cmd, dry_run=self.dry_run)
      File "/usr/local/lib/python3.7/distutils/spawn.py", line 36, in spawn
        _spawn_posix(cmd, search_path, dry_run=dry_run)
      File "/usr/local/lib/python3.7/distutils/spawn.py", line 159, in _spawn_posix
        % (cmd, exit_status))
    distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/usr/local/lib/python3.7/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/local/lib/python3.7/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.7/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/local/lib/python3.7/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.7/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 84, in run
        _build_ext.run(self)
      File "/usr/local/lib/python3.7/distutils/command/build_ext.py", line 340, in run
        self.build_extensions()
      File "/usr/local/lib/python3.7/distutils/command/build_ext.py", line 449, in build_extensions
        self._build_extensions_serial()
      File "/usr/local/lib/python3.7/distutils/command/build_ext.py", line 474, in _build_extensions_serial
        self.build_extension(ext)
      File "/usr/local/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 205, in build_extension
        _build_ext.build_extension(self, ext)
      File "/usr/local/lib/python3.7/distutils/command/build_ext.py", line 534, in build_extension
        depends=ext.depends)
      File "/usr/local/lib/python3.7/distutils/ccompiler.py", line 574, in compile
        self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
      File "/usr/local/lib/python3.7/distutils/unixccompiler.py", line 120, in _compile
        raise CompileError(msg)
    distutils.errors.CompileError: command 'gcc' failed with exit status 1
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/tmp/pip-install-6sx_tmbb/psutil/setup.py", line 393, in main
        setup(**kwargs)
      File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/usr/local/lib/python3.7/distutils/core.py", line 163, in setup
        raise SystemExit("error: " + str(msg))
    SystemExit: error: command 'gcc' failed with exit status 1
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-6sx_tmbb/psutil/setup.py", line 426, in <module>
        main()
      File "/tmp/pip-install-6sx_tmbb/psutil/setup.py", line 400, in main
        missdeps("sudo apt-get install gcc python%s-dev" % py3)
      File "/tmp/pip-install-6sx_tmbb/psutil/setup.py", line 116, in missdeps
        s = hilite("C compiler or Python headers are not installed ", ok=False)
    TypeError: hilite() got an unexpected keyword argument 'ok'
    ----------------------------------------
?[0m?[91mERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6sx_tmbb/psutil/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6sx_tmbb/psutil/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-8s1q36_o/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
?[0m?[91mWARNING: You are using pip version 19.3.1; however, version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
?[0m


The command '/bin/sh -c pip install -r /requirements.txt' returned a non-zero code: 1
```
@JK87iab
Copy link
Author

JK87iab commented Feb 26, 2020

Issue was the azure python image has no gcc
adding RUN apt-get update -y && apt-get install -y gcc fixed it

@JK87iab JK87iab closed this as completed Feb 26, 2020
@brando90
Copy link

brando90 commented Sep 8, 2022

apt-get update -y && apt-get install -y gcc

that didn't work for me even after installing gcc:

(base) root@aa63ef318a41:/# RUN apt-get update -y && apt-get install -y gcc
bash: RUN: command not found
(base) root@aa63ef318a41:/# apt-get update -y && apt-get install -y gcc
Hit:1 http://security.debian.org/debian-security bullseye-security InRelease
Hit:2 http://deb.debian.org/debian bullseye InRelease
Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gcc is already the newest version (4:10.2.1-1).
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
(base) root@aa63ef318a41:/# gcc
gcc: fatal error: no input files
compilation terminated.
(base) root@aa63ef318a41:/# pip install wandb --upgrade
Collecting wandb
  Using cached wandb-0.13.2-py2.py3-none-any.whl (1.8 MB)
Requirement already satisfied: shortuuid>=0.5.0 in /opt/conda/lib/python3.9/site-packages (from wandb) (1.0.9)
Collecting Click!=8.0.0,>=7.0
  Using cached click-8.1.3-py3-none-any.whl (96 kB)
Collecting psutil>=5.0.0
  Using cached psutil-5.9.2.tar.gz (479 kB)
Requirement already satisfied: sentry-sdk>=1.0.0 in /opt/conda/lib/python3.9/site-packages (from wandb) (1.9.8)
Requirement already satisfied: setuptools in /opt/conda/lib/python3.9/site-packages (from wandb) (61.2.0)
Requirement already satisfied: setproctitle in /opt/conda/lib/python3.9/site-packages (from wandb) (1.3.2)
Collecting GitPython>=1.0.0
  Using cached GitPython-3.1.27-py3-none-any.whl (181 kB)
Requirement already satisfied: six>=1.13.0 in /opt/conda/lib/python3.9/site-packages (from wandb) (1.16.0)
Collecting docker-pycreds>=0.4.0
  Using cached docker_pycreds-0.4.0-py2.py3-none-any.whl (9.0 kB)
Requirement already satisfied: PyYAML in /opt/conda/lib/python3.9/site-packages (from wandb) (6.0)
Collecting pathtools
  Using cached pathtools-0.1.2-py3-none-any.whl
Collecting protobuf<4.0dev,>=3.12.0
  Using cached protobuf-3.20.1-cp39-cp39-manylinux2014_aarch64.whl (917 kB)
Requirement already satisfied: requests<3,>=2.0.0 in /opt/conda/lib/python3.9/site-packages (from wandb) (2.27.1)
Collecting promise<3,>=2.0
  Using cached promise-2.3-py3-none-any.whl
Requirement already satisfied: gitdb<5,>=4.0.1 in /opt/conda/lib/python3.9/site-packages (from GitPython>=1.0.0->wandb) (4.0.9)
Requirement already satisfied: smmap<6,>=3.0.1 in /opt/conda/lib/python3.9/site-packages (from gitdb<5,>=4.0.1->GitPython>=1.0.0->wandb) (5.0.0)
Requirement already satisfied: idna<4,>=2.5 in /opt/conda/lib/python3.9/site-packages (from requests<3,>=2.0.0->wandb) (3.3)
Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/lib/python3.9/site-packages (from requests<3,>=2.0.0->wandb) (2021.10.8)
Requirement already satisfied: charset-normalizer~=2.0.0 in /opt/conda/lib/python3.9/site-packages (from requests<3,>=2.0.0->wandb) (2.0.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /opt/conda/lib/python3.9/site-packages (from requests<3,>=2.0.0->wandb) (1.26.12)
Building wheels for collected packages: psutil
  Building wheel for psutil (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/conda/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-st_oegki/psutil_f544a44abeeb41ef87d13bb0e214cd58/setup.py'"'"'; __file__='"'"'/tmp/pip-install-st_oegki/psutil_f544a44abeeb41ef87d13bb0e214cd58/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'"'"'))' bdist_wheel -d /tmp/pip-wheel-iace1o5p
       cwd: /tmp/pip-install-st_oegki/psutil_f544a44abeeb41ef87d13bb0e214cd58/
  Complete output (45 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-3.9
  creating build/lib.linux-aarch64-3.9/psutil
  copying psutil/_psosx.py -> build/lib.linux-aarch64-3.9/psutil
  copying psutil/_psbsd.py -> build/lib.linux-aarch64-3.9/psutil
  copying psutil/_common.py -> build/lib.linux-aarch64-3.9/psutil
  copying psutil/_pswindows.py -> build/lib.linux-aarch64-3.9/psutil
  copying psutil/_psposix.py -> build/lib.linux-aarch64-3.9/psutil
  copying psutil/__init__.py -> build/lib.linux-aarch64-3.9/psutil
  copying psutil/_compat.py -> build/lib.linux-aarch64-3.9/psutil
  copying psutil/_pslinux.py -> build/lib.linux-aarch64-3.9/psutil
  copying psutil/_pssunos.py -> build/lib.linux-aarch64-3.9/psutil
  copying psutil/_psaix.py -> build/lib.linux-aarch64-3.9/psutil
  creating build/lib.linux-aarch64-3.9/psutil/tests
  copying psutil/tests/__main__.py -> build/lib.linux-aarch64-3.9/psutil/tests
  copying psutil/tests/test_process.py -> build/lib.linux-aarch64-3.9/psutil/tests
  copying psutil/tests/test_aix.py -> build/lib.linux-aarch64-3.9/psutil/tests
  copying psutil/tests/test_misc.py -> build/lib.linux-aarch64-3.9/psutil/tests
  copying psutil/tests/test_bsd.py -> build/lib.linux-aarch64-3.9/psutil/tests
  copying psutil/tests/test_linux.py -> build/lib.linux-aarch64-3.9/psutil/tests
  copying psutil/tests/runner.py -> build/lib.linux-aarch64-3.9/psutil/tests
  copying psutil/tests/__init__.py -> build/lib.linux-aarch64-3.9/psutil/tests
  copying psutil/tests/test_connections.py -> build/lib.linux-aarch64-3.9/psutil/tests
  copying psutil/tests/test_unicode.py -> build/lib.linux-aarch64-3.9/psutil/tests
  copying psutil/tests/test_windows.py -> build/lib.linux-aarch64-3.9/psutil/tests
  copying psutil/tests/test_contracts.py -> build/lib.linux-aarch64-3.9/psutil/tests
  copying psutil/tests/test_sunos.py -> build/lib.linux-aarch64-3.9/psutil/tests
  copying psutil/tests/test_testutils.py -> build/lib.linux-aarch64-3.9/psutil/tests
  copying psutil/tests/test_osx.py -> build/lib.linux-aarch64-3.9/psutil/tests
  copying psutil/tests/test_memleaks.py -> build/lib.linux-aarch64-3.9/psutil/tests
  copying psutil/tests/test_posix.py -> build/lib.linux-aarch64-3.9/psutil/tests
  copying psutil/tests/test_system.py -> build/lib.linux-aarch64-3.9/psutil/tests
  running build_ext
  building 'psutil._psutil_linux' extension
  creating build/temp.linux-aarch64-3.9
  creating build/temp.linux-aarch64-3.9/psutil
  gcc -pthread -B /opt/conda/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -n1 .2-a+fp16+rcpc+dotprod+crypto -isystem /opt/conda/include -I/opt/conda/include -fPIC -O2 -n1 .2-a+fp16+rcpc+dotprod+crypto -isystem /opt/conda/include -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=592 -DPSUTIL_LINUX=1 -I/opt/conda/include/python3.9 -c psutil/_psutil_common.c -o build/temp.linux-aarch64-3.9/psutil/_psutil_common.o
  gcc: error: .2-a+fp16+rcpc+dotprod+crypto: No such file or directory
  gcc: error: .2-a+fp16+rcpc+dotprod+crypto: No such file or directory
  gcc: error: unrecognized command-line option ‘-n1’; did you mean ‘-n’?
  gcc: error: unrecognized command-line option ‘-n1’; did you mean ‘-n’?
  error: command '/usr/bin/gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for psutil
  Running setup.py clean for psutil
Failed to build psutil
Installing collected packages: psutil, protobuf, promise, pathtools, GitPython, docker-pycreds, Click, wandb
    Running setup.py install for psutil ... error
    ERROR: Command errored out with exit status 1:
     command: /opt/conda/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-st_oegki/psutil_f544a44abeeb41ef87d13bb0e214cd58/setup.py'"'"'; __file__='"'"'/tmp/pip-install-st_oegki/psutil_f544a44abeeb41ef87d13bb0e214cd58/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'"'"'))' install --record /tmp/pip-record-3gqidhom/install-record.txt --single-version-externally-managed --compile --install-headers /opt/conda/include/python3.9/psutil
         cwd: /tmp/pip-install-st_oegki/psutil_f544a44abeeb41ef87d13bb0e214cd58/
    Complete output (47 lines):
    running install
    /opt/conda/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    running build
    running build_py
    creating build
    creating build/lib.linux-aarch64-3.9
    creating build/lib.linux-aarch64-3.9/psutil
    copying psutil/_psosx.py -> build/lib.linux-aarch64-3.9/psutil
    copying psutil/_psbsd.py -> build/lib.linux-aarch64-3.9/psutil
    copying psutil/_common.py -> build/lib.linux-aarch64-3.9/psutil
    copying psutil/_pswindows.py -> build/lib.linux-aarch64-3.9/psutil
    copying psutil/_psposix.py -> build/lib.linux-aarch64-3.9/psutil
    copying psutil/__init__.py -> build/lib.linux-aarch64-3.9/psutil
    copying psutil/_compat.py -> build/lib.linux-aarch64-3.9/psutil
    copying psutil/_pslinux.py -> build/lib.linux-aarch64-3.9/psutil
    copying psutil/_pssunos.py -> build/lib.linux-aarch64-3.9/psutil
    copying psutil/_psaix.py -> build/lib.linux-aarch64-3.9/psutil
    creating build/lib.linux-aarch64-3.9/psutil/tests
    copying psutil/tests/__main__.py -> build/lib.linux-aarch64-3.9/psutil/tests
    copying psutil/tests/test_process.py -> build/lib.linux-aarch64-3.9/psutil/tests
    copying psutil/tests/test_aix.py -> build/lib.linux-aarch64-3.9/psutil/tests
    copying psutil/tests/test_misc.py -> build/lib.linux-aarch64-3.9/psutil/tests
    copying psutil/tests/test_bsd.py -> build/lib.linux-aarch64-3.9/psutil/tests
    copying psutil/tests/test_linux.py -> build/lib.linux-aarch64-3.9/psutil/tests
    copying psutil/tests/runner.py -> build/lib.linux-aarch64-3.9/psutil/tests
    copying psutil/tests/__init__.py -> build/lib.linux-aarch64-3.9/psutil/tests
    copying psutil/tests/test_connections.py -> build/lib.linux-aarch64-3.9/psutil/tests
    copying psutil/tests/test_unicode.py -> build/lib.linux-aarch64-3.9/psutil/tests
    copying psutil/tests/test_windows.py -> build/lib.linux-aarch64-3.9/psutil/tests
    copying psutil/tests/test_contracts.py -> build/lib.linux-aarch64-3.9/psutil/tests
    copying psutil/tests/test_sunos.py -> build/lib.linux-aarch64-3.9/psutil/tests
    copying psutil/tests/test_testutils.py -> build/lib.linux-aarch64-3.9/psutil/tests
    copying psutil/tests/test_osx.py -> build/lib.linux-aarch64-3.9/psutil/tests
    copying psutil/tests/test_memleaks.py -> build/lib.linux-aarch64-3.9/psutil/tests
    copying psutil/tests/test_posix.py -> build/lib.linux-aarch64-3.9/psutil/tests
    copying psutil/tests/test_system.py -> build/lib.linux-aarch64-3.9/psutil/tests
    running build_ext
    building 'psutil._psutil_linux' extension
    creating build/temp.linux-aarch64-3.9
    creating build/temp.linux-aarch64-3.9/psutil
    gcc -pthread -B /opt/conda/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -n1 .2-a+fp16+rcpc+dotprod+crypto -isystem /opt/conda/include -I/opt/conda/include -fPIC -O2 -n1 .2-a+fp16+rcpc+dotprod+crypto -isystem /opt/conda/include -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=592 -DPSUTIL_LINUX=1 -I/opt/conda/include/python3.9 -c psutil/_psutil_common.c -o build/temp.linux-aarch64-3.9/psutil/_psutil_common.o
    gcc: error: .2-a+fp16+rcpc+dotprod+crypto: No such file or directory
    gcc: error: .2-a+fp16+rcpc+dotprod+crypto: No such file or directory
    gcc: error: unrecognized command-line option ‘-n1’; did you mean ‘-n’?
    gcc: error: unrecognized command-line option ‘-n1’; did you mean ‘-n’?
    error: command '/usr/bin/gcc' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /opt/conda/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-st_oegki/psutil_f544a44abeeb41ef87d13bb0e214cd58/setup.py'"'"'; __file__='"'"'/tmp/pip-install-st_oegki/psutil_f544a44abeeb41ef87d13bb0e214cd58/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'"'"'))' install --record /tmp/pip-record-3gqidhom/install-record.txt --single-version-externally-managed --compile --install-headers /opt/conda/include/python3.9/psutil Check the logs for full command output.

@brando90
Copy link

brando90 commented Sep 8, 2022

the solution in this article seems to work for me: https://stackoverflow.com/questions/73323180/docker-centos7-image-psutil-get-installed-on-windows-linux-but-failed-on-mac

basically add the --platform linux/amd64 to build and I assume to every further command too.

@MuhammadShifa
Copy link

Thanks @JK87iab , I have fixed the issue with this command RUN apt-get update -y && apt-get install -y gcc python3-dev

@elotech47
Copy link

the solution in this article seems to work for me: https://stackoverflow.com/questions/73323180/docker-centos7-image-psutil-get-installed-on-windows-linux-but-failed-on-mac

basically add the --platform linux/amd64 to build and I assume to every further command too.

This works for me. I was creating the image from my Mac hence the error, but specifying the plaform as linux/amd64 fixed it.
Thanks @brando90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants