I had this problem when installing !pip install google-colab
outside of Google Colab, on another platform, but still inside a Jupyter Notebook of course. The fix was not to install it at all since no other platform than Google Colab can install the google-colab
module.
This is the long !pip install google-colab
error output, it ends with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
:
Defaulting to user installation because normal site-packages is not writeable
Collecting google-colab
Using cached google_colab-1.0.0-py2.py3-none-any.whl
Collecting google-auth~=1.4.0 (from google-colab)
Using cached google_auth-1.4.2-py2.py3-none-any.whl (64 kB)
Requirement already satisfied: ipykernel~=4.6.0 in /srv/home/tester/.local/lib/python3.8/site-packages (from google-colab) (4.6.1)
Requirement already satisfied: ipython~=5.5.0 in /srv/home/tester/.local/lib/python3.8/site-packages (from google-colab) (5.5.0)
Collecting notebook~=5.2.0 (from google-colab)
Using cached notebook-5.2.2-py2.py3-none-any.whl (8.0 MB)
Requirement already satisfied: six~=1.12.0 in /srv/home/tester/.local/lib/python3.8/site-packages (from google-colab) (1.12.0)
Collecting pandas~=0.24.0 (from google-colab)
Using cached pandas-0.24.2.tar.gz (11.8 MB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: portpicker~=1.2.0 in /srv/home/tester/.local/lib/python3.8/site-packages (from google-colab) (1.2.0)
...
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.8/dist-packages (from packaging->nbconvert->notebook~=5.2.0->google-colab) (2.4.7)
Building wheels for collected packages: pandas
Building wheel for pandas (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [2070 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/pandas
copying pandas/__init__.py -> build/lib.linux-x86_64-3.8/pandas
copying pandas/_version.py -> build/lib.linux-x86_64-3.8/pandas
copying pandas/testing.py -> build/lib.linux-x86_64-3.8/pandas
copying pandas/conftest.py -> build/lib.linux-x86_64-3.8/pandas
creating build/lib.linux-x86_64-3.8/pandas/_libs
copying pandas/_libs/__init__.py -> build/lib.linux-x86_64-3.8/pandas/_libs
creating build/lib.linux-x86_64-3.8/pandas/io
copying pandas/io/excel.py -> build/lib.linux-x86_64-3.8/pandas/io
copying pandas/io/api.py -> build/lib.linux-x86_64-3.8/pandas/io
copying pandas/io/html.py -> build/lib.linux-x86_64-3.8/pandas/io
copying pandas/io/pytables.py -> build/lib.linux-x86_64-3.8/pandas/io
copying pandas/io/feather_format.py -> build/lib.linux-x86_64-3.8/pandas/io
copying pandas/io/__init__.py -> build/lib.linux-x86_64-3.8/pandas/io
copying pandas/io/s3.py -> build/lib.linux-x86_64-3.8/pandas/io
...
creating build/lib.linux-x86_64-3.8/pandas/api/types
copying pandas/api/types/__init__.py -> build/lib.linux-x86_64-3.8/pandas/api/types
...
pandas/_libs/interval.c:112435:41: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_uint64_t’ {aka ‘long unsigned int’} and ‘__pyx_t_5numpy_int64_t’ {aka ‘long int’} [-Wsign-compare]
112435 | __pyx_t_14 = ((!((__pyx_v_point < (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_values.data + __pyx_t_12 * __pyx_v_values.strides[0]) )))) != 0)) != 0);
...
pandas/_libs/src/parser/tokenizer.c: In function ‘_tokenize_helper’:
pandas/_libs/src/parser/tokenizer.c:1369:47: warning: comparison of integer expressions of different signedness: ‘int64_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
1369 | if (!all && self->lines - start_lines >= nrows) break;
| ^~
In file included from /usr/include/string.h:495,
from pandas/_libs/src/parser/tokenizer.h:18,
from pandas/_libs/src/parser/tokenizer.c:20:
In function ‘strncpy’,
inlined from ‘append_warning’ at pandas/_libs/src/parser/tokenizer.c:435:13,
inlined from ‘end_line’ at pandas/_libs/src/parser/tokenizer.c:506:17:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pandas/_libs/src/parser/tokenizer.c: In function ‘end_line’:
...
189 | static PyDateTime_CAPI *PyDateTimeAPI = NULL;
| ^~~~~~~~~~~~~
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I./pandas/_libs/tslibs -Ipandas/_libs/tslibs -Ipandas/_libs/tslibs/src -I/srv/home/tester/.local/lib/python3.8/site-packages/numpy/core/include -I/usr/include/python3.8 -c pandas/_libs/tslibs/src/datetime/np_datetime_strings.c -o build/temp.linux-x86_64-3.8/pandas/_libs/tslibs/src/datetime/np_datetime_strings.o -Wno-unused-function
...
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ipandas/_libs/src/ujson/python -Ipandas/_libs/src/ujson/lib -Ipandas/_libs/src/datetime -I/srv/home/tester/.local/lib/python3.8/site-packages/numpy/core/include -I/usr/include/python3.8 -c pandas/_libs/src/ujson/python/objToJSON.c -o build/temp.linux-x86_64-3.8/pandas/_libs/src/ujson/python/objToJSON.o -D_GNU_SOURCE -Wno-unused-function
In file included from /srv/home/tester/.local/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1960,
from /srv/home/tester/.local/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /srv/home/tester/.local/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,
from pandas/_libs/src/ujson/python/objToJSON.c:44:
/srv/home/tester/.local/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
17 | #warning "Using deprecated NumPy API, disable it with " \
| ^~~~~~~
pandas/_libs/src/ujson/python/objToJSON.c: In function ‘initObjToJSON’:
pandas/_libs/src/ujson/python/objToJSON.c:194:12: error: ‘NUMPY_IMPORT_ARRAY_RETVAL’ undeclared (first use in this function)
194 | return NUMPY_IMPORT_ARRAY_RETVAL;
| ^~~~~~~~~~~~~~~~~~~~~~~~~
pandas/_libs/src/ujson/python/objToJSON.c:194:12: note: each undeclared identifier is reported only once for each function it appears in
pandas/_libs/src/ujson/python/objToJSON.c:195:1: warning: control reaches end of non-void function [-Wreturn-type]
195 | }
| ^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pandas
Running setup.py clean for pandas
Failed to build pandas
ERROR: Could not build wheels for pandas, which is required to install pyproject.toml-based projects
sudo apt-get update && sudo apt-get install libssl-dev
to get them. There likely will be other dependencies. – Interventionist