Streamlit Cloud: ModuleNotFoundError: No module named 'cmake'

I’ve been unsuccessful to get a streamlit app running in a codespace container. I’ve tried a variety of versions and not specifying versions in the requirements.txt file, but always get this error.

Any thoughts appreciated!

Requirements.txt:
streamlit==1.17.0
google-auth==2.14.0
google-cloud-bigquery
db-dtypes==1.0.4
json5==0.8.4
jsonschema==3.0.1
plotly==5.11.0
plotly-express==0.4.0
jj-data-connector @ git+https://github.com/DataSolveProblems/jj_data_connector.git@ea9ccde1fee7ad382f5e145f5a0bfc7e26a2341c
gsheetsdb==0.1.13.1
millify==0.1.1
plotly-calplot==0.1.7
altair==4.0

– Running cmake for pyarrow
cmake -DPYTHON_EXECUTABLE=/usr/local/bin/python -DPython3_EXECUTABLE=/usr/local/bin/python “” -DPYARROW_BUILD_CUDA=off -DPYARROW_BUILD_SUBSTRAIT=off -DPYARROW_BUILD_FLIGHT=off -DPYARROW_BUILD_GANDIVA=off -DPYARROW_BUILD_DATASET=off -DPYARROW_BUILD_ORC=off -DPYARROW_BUILD_PARQUET=off -DPYARROW_BUILD_PARQUET_ENCRYPTION=off -DPYARROW_BUILD_PLASMA=off -DPYARROW_BUILD_GCS=off -DPYARROW_BUILD_S3=off -DPYARROW_BUILD_HDFS=off -DPYARROW_USE_TENSORFLOW=off -DPYARROW_BUNDLE_ARROW_CPP=off -DPYARROW_BUNDLE_BOOST=off -DPYARROW_GENERATE_COVERAGE=off -DPYARROW_BOOST_USE_SHARED=on -DPYARROW_PARQUET_USE_SHARED=on -DCMAKE_BUILD_TYPE=release /tmp/pip-install-ohe2bhn9/pyarrow_636158004fee475ea8af2823cf5677d2
Traceback (most recent call last):
File “/home/vscode/.local/bin/cmake”, line 5, in
from cmake import cmake
ModuleNotFoundError: No module named ‘cmake’
error: command ‘/home/vscode/.local/bin/cmake’ failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyarrow
2023-10-05 00:13:08.961Z: e[?25h Building wheel for moz_sql_parser (setup.py) … e[?25l-2023-10-05 00:13:09.033Z:  done
2023-10-05 00:13:09.037Z: e[?25h Created wheel for moz_sql_parser: filename=moz_sql_parser-4.40.21126-py3-none-any.whl size=75195 sha256=87ed1beb4243149c78638106cc10ddba94a59e3913ff9430ba82147ae3c9e833
2023-10-05 00:13:09.050Z: Stored in directory: /home/vscode/.cache/pip/wheels/c8/c3/31/f162891ebaaa2ac6f64f19dafb255d136ea40b6e09073cc92f
2023-10-05 00:13:09.196Z: Building wheel for mo-dots (setup.py) … e[?25l-2023-10-05 00:13:09.254Z:  done
2023-10-05 00:13:09.263Z: e[?25h Created wheel for mo-dots: filename=mo_dots-4.22.21108-py3-none-any.whl size=19804 sha256=7af751b0225aa576c7b7b58dd3fa912350311212a09da3a1b27c906a7770e9362023-10-05 00:13:09.275Z:
2023-10-05 00:13:09.292Z: Stored in directory: /home/vscode/.cache/pip/wheels/c2/01/7a/6e712639cce91a62c1272571a49f3c8b0879fd538d235ca8322023-10-05 00:13:09.312Z:
2023-10-05 00:13:09.433Z: Building wheel for mo-future (setup.py) … e[?25l-2023-10-05 00:13:09.487Z:  done
2023-10-05 00:13:09.490Z: e[?25h Created wheel for mo-future: filename=mo_future-3.147.20327-py3-none-any.whl size=4499 sha256=096dae8188f0d7229ac4c4b42cfbfbd7a99e7a1ae1cf6510cff0e11a6b7056da
Stored in directory: /home/vscode/.cache/pip/wheels/0c/53/ab/0dcc15d1abf3a115084a4bbddbd1b238b8ac118aa14d5209cf
2023-10-05 00:13:09.649Z: Building wheel for mo-logs (setup.py) … e[?25l-2023-10-05 00:13:09.714Z:  done
2023-10-05 00:13:09.718Z: e[?25h Created wheel for mo-logs: filename=mo_logs-4.23.21108-py3-none-any.whl size=39449 sha256=ff12ef4e3611a533a67ae691c267f37b970f183a7c52a10ef578c511dc42101f
Stored in directory: /home/vscode/.cache/pip/wheels/50/7b/08/5dbaa66bcd32ae56724402be654a7349c29e58c8c9f556adc8
2023-10-05 00:13:09.875Z: Building wheel for mo-imports (setup.py) … e[?25l-2023-10-05 00:13:09.933Z:  done
2023-10-05 00:13:09.939Z: e[?25h Created wheel for mo-imports: filename=mo_imports-3.149.20327-py3-none-any.whl size=5081 sha256=33e68fd2bd0896240540208ddcbaaf0a3aa317c17ee8fda5f6867725125bb283
2023-10-05 00:13:09.978Z: Stored in directory: /home/vscode/.cache/pip/wheels/9f/25/93/da32dc0b41e48292bafd27fbf08201efe06f3b042fdcaefe6e
2023-10-05 00:13:10.164Z: Building wheel for mo-kwargs (setup.py) … e[?25l-2023-10-05 00:13:10.234Z:  done
2023-10-05 00:13:10.257Z: e[?25h Created wheel for mo-kwargs: filename=mo_kwargs-4.22.21108-py3-none-any.whl size=6713 sha256=e3cb88cd36dfd67816fdef7da5357a4f7e4692cc57576032edc4174cf6ada7412023-10-05 00:13:10.269Z:
2023-10-05 00:13:10.283Z: Stored in directory: /home/vscode/.cache/pip/wheels/9b/78/c0/ea6ffbeed0af4777c27d8ab81b36707623b8054f339383d1c32023-10-05 00:13:10.290Z:
2023-10-05 00:13:10.307Z: Successfully built gsheetsdb millify jj-data-connector moz_sql_parser mo-dots mo-future mo-logs mo-imports mo-kwargs2023-10-05 00:13:10.323Z:
2023-10-05 00:13:10.338Z: Failed to build pyarrow2023-10-05 00:13:10.358Z:
2023-10-05 00:13:10.370Z: ERROR: Could not build wheels for pyarrow, which is required to install pyproject.toml-based projects2023-10-05 00:13:10.398Z:
2023-10-05 00:13:10.410Z: 2023-10-05 00:13:10.690Z: updateContentCommand failed with exit code 1. Skipping any further user-provided commands.

2023-10-05 00:13:10.707Z: Error: Command failed: /bin/sh -c [ -f packages.txt ] && sudo apt update && sudo apt upgrade && sudo xargs apt install -y <packages.txt; pip install --upgrade cmake; pip3 install --user -r requirements.txt
2023-10-05 00:13:10.721Z: at OY (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:235:130)
2023-10-05 00:13:10.742Z: at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2023-10-05 00:13:10.746Z: at async Nl (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:227:4393)
2023-10-05 00:13:10.759Z: at async Rl (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:227:3738)
2023-10-05 00:13:10.770Z: at async Ml (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:227:2814)
2023-10-05 00:13:10.780Z: at async Js (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:227:2386)
2023-10-05 00:13:10.790Z: at async aAA (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:462:1346)
2023-10-05 00:13:10.807Z: at async SK (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:462:964)
2023-10-05 00:13:10.816Z: at async SAA (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:479:3660)
2023-10-05 00:13:10.831Z: at async GC (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:479:4775)
2023-10-05 00:13:10.858Z: {“outcome”:“error”,“message”:“Command failed: /bin/sh -c [ -f packages.txt ] && sudo apt update && sudo apt upgrade && sudo xargs apt install -y <packages.txt; pip install --upgrade cmake; pip3 install --user -r requirements.txt”,“description”:“The updateContentCommand in the devcontainer.json failed.”,“containerId”:“3ba872e28bfded9b87c84ab277cc1c8b47b9d04b17410199573abb3a8653f18f”}
2023-10-05 00:13:10.872Z: devcontainer process exited with exit code 1

====================================== ERROR ====================================
2023-10-05 00:13:10.878Z: Failed to create container.

2023-10-05 00:13:10.884Z: Error: Command failed: /bin/sh -c [ -f packages.txt ] && sudo apt update && sudo apt upgrade && sudo xargs apt install -y <packages.txt; pip install --upgrade cmake; pip3 install --user -r requirements.txt
2023-10-05 00:13:10.893Z: Error code: 1302 (UnifiedContainersErrorFatalCreatingContainer)

====================================== ERROR ====================================
2023-10-05 00:13:10.903Z: Container creation failed.

Hi @obie

It seems cmake is not installed, which is required to compile some dependent libraries. Firstly, please see if you can first install it:

sudo apt-get -y install cmake

Then via pip:

pip install cmake

This is in a codespace using an image that streamlit uses in their sample application so it seems it should be there.

I indirectly solved this by removing all of the specific versioning in the requirements.txt file, although this doesn’t explain why streamlit couldn’t find cmake.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.