When I use %pip install fastai
I get following error
Failed to build bcolz lxml
ERROR: Could not build wheels for bcolz, lxml, which is required to install pyproject.toml-based projects
So I ran following command also
%pip install bcolz
but this also failed
Failed to build bcolz
ERROR: Could not build wheels for bcolz, which is required to install pyproject.toml-based projects
When I run !pip install fastai in jupyter notebook it succeeds without any complaint. Strangely I install it in Jupyter notebook and can use it in terminal without any issues!
Below are the log outputs of attempts to try installing lxml and bcolz!
%pip install lxml
Requirement already satisfied: lxml in /opt/homebrew/Cellar/jupyterlab/4.0.10/libexec/lib/python3.12/site-packages (5.1.0)
Note: you may need to restart the kernel to use updated packages.
%pip install bcolz
Collecting bcolz
Using cached bcolz-1.2.1.tar.gz (1.5 MB)
Preparing metadata (setup.py) ... done
Collecting numpy>=1.7 (from bcolz)
Using cached numpy-1.26.3-cp312-cp312-macosx_11_0_arm64.whl.metadata (61 kB)
Using cached numpy-1.26.3-cp312-cp312-macosx_11_0_arm64.whl (13.7 MB)
Building wheels for collected packages: bcolz
Building wheel for bcolz (setup.py) ... error
error: subprocess-exited-with-error
Ă python setup.py bdist_wheel did not run successfully.
â exit code: 1
â°â> [111 lines of output]
/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-install-xphqykjk/bcolz_04533703bde743f7826034d3ef7cc2a5/setup.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import resource_filename
/opt/homebrew/lib/python3.12/site-packages/setuptools/__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!
********************************************************************************
Requirements should be satisfied by a PEP 517 installer.
If you are using pip, you can try `pip install --use-pep517`.
********************************************************************************
!!
dist.fetch_build_eggs(dist.setup_requires)
WARNING setuptools_scm.pyproject_reading toml section missing 'pyproject.toml does not contain a tool.setuptools_scm section'
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-13-arm64-cpython-312
creating build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/py2help_tests.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/version.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/toplevel.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/ctable.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/__init__.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/utils.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/chunked_eval.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/defaults.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/attrs.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/py2help.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/arrayprint.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
creating build/lib.macosx-13-arm64-cpython-312/bcolz/tests
copying bcolz/tests/test_ndcarray.py -> build/lib.macosx-13-arm64-cpython-312/bcolz/tests
copying bcolz/tests/test_carray_objects.py -> build/lib.macosx-13-arm64-cpython-312/bcolz/tests
copying bcolz/tests/test_attrs.py -> build/lib.macosx-13-arm64-cpython-312/bcolz/tests
copying bcolz/tests/__init__.py -> build/lib.macosx-13-arm64-cpython-312/bcolz/tests
copying bcolz/tests/all.py -> build/lib.macosx-13-arm64-cpython-312/bcolz/tests
copying bcolz/tests/common.py -> build/lib.macosx-13-arm64-cpython-312/bcolz/tests
copying bcolz/tests/test_queries.py -> build/lib.macosx-13-arm64-cpython-312/bcolz/tests
copying bcolz/tests/test_ctable.py -> build/lib.macosx-13-arm64-cpython-312/bcolz/tests
copying bcolz/tests/test_carray.py -> build/lib.macosx-13-arm64-cpython-312/bcolz/tests
copying bcolz/carray_ext.pxd -> build/lib.macosx-13-arm64-cpython-312/bcolz
running build_ext
Compiling bcolz/carray_ext.pyx because it changed.
[1/1] Cythonizing bcolz/carray_ext.pyx
/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-install-xphqykjk/bcolz_04533703bde743f7826034d3ef7cc2a5/.eggs/Cython-3.0.8-py3.12.egg/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-install-xphqykjk/bcolz_04533703bde743f7826034d3ef7cc2a5/bcolz/carray_ext.pxd
tree = Parsing.p_module(s, pxd, full_module_name)
Error compiling Cython file:
------------------------------------------------------------
...
# Create the final container and fill it
out = carray([], dtype=newdtype, cparams=self.cparams,
expectedlen=newlen,
rootdir=rootdir, mode='w')
if newlen < ilen:
rsize = isize / newlen
^
------------------------------------------------------------
bcolz/carray_ext.pyx:1685:26: Cannot assign type 'double' to 'npy_intp'
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-install-xphqykjk/bcolz_04533703bde743f7826034d3ef7cc2a5/setup.py", line 161, in <module>
setup(
File "/opt/homebrew/lib/python3.12/site-packages/setuptools/__init__.py", line 103, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/opt/homebrew/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/opt/homebrew/lib/python3.12/site-packages/setuptools/dist.py", line 963, in run_command
super().run_command(command)
File "/opt/homebrew/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/opt/homebrew/lib/python3.12/site-packages/wheel/bdist_wheel.py", line 368, in run
self.run_command("build")
File "/opt/homebrew/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/opt/homebrew/lib/python3.12/site-packages/setuptools/dist.py", line 963, in run_command
super().run_command(command)
File "/opt/homebrew/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/opt/homebrew/lib/python3.12/site-packages/setuptools/_distutils/command/build.py", line 131, in run
self.run_command(cmd_name)
File "/opt/homebrew/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/opt/homebrew/lib/python3.12/site-packages/setuptools/dist.py", line 963, in run_command
super().run_command(command)
File "/opt/homebrew/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/opt/homebrew/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
self.build_extensions()
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-install-xphqykjk/bcolz_04533703bde743f7826034d3ef7cc2a5/setup.py", line 77, in build_extensions
cython_build_ext.build_extensions(self)
File "/opt/homebrew/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
self._build_extensions_serial()
File "/opt/homebrew/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
self.build_extension(ext)
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-install-xphqykjk/bcolz_04533703bde743f7826034d3ef7cc2a5/.eggs/Cython-3.0.8-py3.12.egg/Cython/Distutils/build_ext.py", line 130, in build_extension
new_ext = cythonize(
^^^^^^^^^^
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-install-xphqykjk/bcolz_04533703bde743f7826034d3ef7cc2a5/.eggs/Cython-3.0.8-py3.12.egg/Cython/Build/Dependencies.py", line 1154, in cythonize
cythonize_one(*args)
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-install-xphqykjk/bcolz_04533703bde743f7826034d3ef7cc2a5/.eggs/Cython-3.0.8-py3.12.egg/Cython/Build/Dependencies.py", line 1321, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: bcolz/carray_ext.pyx
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for bcolz
Running setup.py clean for bcolz
Failed to build bcolz
ERROR: Could not build wheels for bcolz, which is required to install pyproject.toml-based projects
Note: you may need to restart the kernel to use updated packages.
%pip install --use-pep517 bcolz
Using cached bcolz-1.2.1.tar.gz (1.5 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Collecting numpy>=1.7 (from bcolz)
Using cached numpy-1.26.3-cp312-cp312-macosx_11_0_arm64.whl.metadata (61 kB)
Using cached numpy-1.26.3-cp312-cp312-macosx_11_0_arm64.whl (13.7 MB)
Building wheels for collected packages: bcolz
Building wheel for bcolz (pyproject.toml) ... error
error: subprocess-exited-with-error
Ă Building wheel for bcolz (pyproject.toml) did not run successfully.
â exit code: 1
â°â> [113 lines of output]
<string>:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
WARNING setuptools_scm.pyproject_reading toml section missing 'pyproject.toml does not contain a tool.setuptools_scm section'
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-13-arm64-cpython-312
creating build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/py2help_tests.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/version.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/toplevel.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/ctable.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/__init__.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/utils.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/chunked_eval.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/defaults.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/attrs.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/py2help.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
copying bcolz/arrayprint.py -> build/lib.macosx-13-arm64-cpython-312/bcolz
creating build/lib.macosx-13-arm64-cpython-312/bcolz/tests
copying bcolz/tests/test_ndcarray.py -> build/lib.macosx-13-arm64-cpython-312/bcolz/tests
copying bcolz/tests/test_carray_objects.py -> build/lib.macosx-13-arm64-cpython-312/bcolz/tests
copying bcolz/tests/test_attrs.py -> build/lib.macosx-13-arm64-cpython-312/bcolz/tests
copying bcolz/tests/__init__.py -> build/lib.macosx-13-arm64-cpython-312/bcolz/tests
copying bcolz/tests/all.py -> build/lib.macosx-13-arm64-cpython-312/bcolz/tests
copying bcolz/tests/common.py -> build/lib.macosx-13-arm64-cpython-312/bcolz/tests
copying bcolz/tests/test_queries.py -> build/lib.macosx-13-arm64-cpython-312/bcolz/tests
copying bcolz/tests/test_ctable.py -> build/lib.macosx-13-arm64-cpython-312/bcolz/tests
copying bcolz/tests/test_carray.py -> build/lib.macosx-13-arm64-cpython-312/bcolz/tests
copying bcolz/carray_ext.pxd -> build/lib.macosx-13-arm64-cpython-312/bcolz
running build_ext
Compiling bcolz/carray_ext.pyx because it changed.
[1/1] Cythonizing bcolz/carray_ext.pyx
/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/normal/lib/python3.12/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-install-rr8_2r31/bcolz_d374897891334aac8e8095723e5b4c5f/bcolz/carray_ext.pxd
tree = Parsing.p_module(s, pxd, full_module_name)
Error compiling Cython file:
------------------------------------------------------------
...
# Create the final container and fill it
out = carray([], dtype=newdtype, cparams=self.cparams,
expectedlen=newlen,
rootdir=rootdir, mode='w')
if newlen < ilen:
rsize = isize / newlen
^
------------------------------------------------------------
bcolz/carray_ext.pyx:1685:26: Cannot assign type 'double' to 'npy_intp'
Traceback (most recent call last):
File "/opt/homebrew/Cellar/jupyterlab/4.0.10/libexec/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/opt/homebrew/Cellar/jupyterlab/4.0.10/libexec/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/jupyterlab/4.0.10/libexec/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 404, in build_wheel
return self._build_with_temp_dir(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 389, in _build_with_temp_dir
self.run_setup()
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 480, in run_setup
super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
exec(code, locals())
File "<string>", line 161, in <module>
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 103, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 963, in run_command
super().run_command(command)
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/wheel/bdist_wheel.py", line 368, in run
self.run_command("build")
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 963, in run_command
super().run_command(command)
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/build.py", line 131, in run
self.run_command(cmd_name)
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 963, in run_command
super().run_command(command)
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
self.build_extensions()
File "<string>", line 77, in build_extensions
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
self._build_extensions_serial()
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
self.build_extension(ext)
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/normal/lib/python3.12/site-packages/Cython/Distutils/build_ext.py", line 130, in build_extension
new_ext = cythonize(
^^^^^^^^^^
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/normal/lib/python3.12/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
cythonize_one(*args)
File "/private/var/folders/mh/x1j9_31x1yjfm8lv47m9dg_80000gr/T/pip-build-env-m3s458ec/normal/lib/python3.12/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: bcolz/carray_ext.pyx
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for bcolz
Failed to build bcolz
ERROR: Could not build wheels for bcolz, which is required to install pyproject.toml-based projects
Note: you may need to restart the kernel to use updated packages.``