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

Python Not Found #1646

Open
charlieartist opened this issue Oct 13, 2023 · 5 comments
Open

Python Not Found #1646

charlieartist opened this issue Oct 13, 2023 · 5 comments

Comments

@charlieartist
Copy link

In getting the Docker container set up, am able to run npm install fine, but hit a stumbling block on docker-compose up, primarily around the inability to find any version of Python. The command will return:

4.921 gyp ERR! find Python 
4.921 gyp ERR! find Python Python is not set from command line or npm configuration
4.921 gyp ERR! find Python Python is not set from environment variable PYTHON
4.921 gyp ERR! find Python checking if "python" can be used
4.921 gyp ERR! find Python - "python" is not in PATH or produced an error
4.921 gyp ERR! find Python checking if "python2" can be used
4.921 gyp ERR! find Python - "python2" is not in PATH or produced an error
4.921 gyp ERR! find Python checking if "python3" can be used
4.921 gyp ERR! find Python - "python3" is not in PATH or produced an error

To be sure there were no issues, I updated Node, Brew, and Python. When I run python3 --version, I get the expected Python 3.12.0, which indicates it's in the PATH.

Is there a specific setup needed for running on Apple Silicon?

@rmoskal
Copy link

rmoskal commented Oct 13, 2023

A lot of vendors having trouble this week! Is mercury in retrograde?

I'm having the same issue of fedora 38.

@smshafa
Copy link

smshafa commented Oct 23, 2023

I had this problem too, when I tried to build the image in Windows:

[formio 9/11] RUN npm ci --prefix=/.npm-packages:
53.56
53.56 > isolated-vm@4.6.0 install /.npm-packages/node_modules/isolated-vm
53.56 > prebuild-install || (node-gyp rebuild --release -j 4 && node-gyp clean)
53.56
54.35 prebuild-install warn install No prebuilt binaries found (target=14.17.0 runtime=node arch=x64 libc=musl platform=linux)
54.49 gyp ERR! find Python
54.49 gyp ERR! find Python Python is not set from command line or npm configuration
54.49 gyp ERR! find Python Python is not set from environment variable PYTHON
54.49 gyp ERR! find Python checking if "python" can be used
54.50 gyp ERR! find Python - "python" is not in PATH or produced an error
54.50 gyp ERR! find Python checking if "python2" can be used
54.50 gyp ERR! find Python - "python2" is not in PATH or produced an error
54.50 gyp ERR! find Python checking if "python3" can be used
54.50 gyp ERR! find Python - "python3" is not in PATH or produced an error
54.50 gyp ERR! find Python
54.50 gyp ERR! find Python **********************************************************
54.50 gyp ERR! find Python You need to install the latest version of Python.
54.50 gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
54.50 gyp ERR! find Python you can try one of the following options:
54.50 gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
54.50 gyp ERR! find Python (accepted by both node-gyp and npm)
54.50 gyp ERR! find Python - Set the environment variable PYTHON
54.50 gyp ERR! find Python - Set the npm configuration variable python:
54.50 gyp ERR! find Python npm config set python "/path/to/pythonexecutable"
54.50 gyp ERR! find Python For more information consult the documentation at:
54.50 gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
54.50 gyp ERR! find Python **********************************************************
54.50 gyp ERR! find Python
54.50 gyp ERR! configure error
54.50 gyp ERR! stack Error: Could not find any Python installation to use
54.50 gyp ERR! stack at PythonFinder.fail (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:307:47)
54.50 gyp ERR! stack at PythonFinder.runChecks (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:136:21)
54.50 gyp ERR! stack at PythonFinder. (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:179:16)
54.50 gyp ERR! stack at PythonFinder.execFileCallback (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:271:16)
54.50 gyp ERR! stack at exithandler (child_process.js:326:5)
54.50 gyp ERR! stack at ChildProcess.errorhandler (child_process.js:338:5)
54.50 gyp ERR! stack at ChildProcess.emit (events.js:376:20)
54.50 gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
54.50 gyp ERR! stack at onErrorNT (internal/child_process.js:467:16)
54.50 gyp ERR! stack at processTicksAndRejections (internal/process/task_queues.js:82:21)
54.50 gyp ERR! System Linux 5.10.102.1-microsoft-standard-WSL2
54.50 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release" "-j" "4"
54.50 gyp ERR! cwd /.npm-packages/node_modules/isolated-vm
54.50 gyp ERR! node -v v14.17.0
54.50 gyp ERR! node-gyp -v v5.1.0
54.50 gyp ERR! not ok
54.51 npm ERR! code ELIFECYCLE
54.51 npm ERR! errno 1
54.53 npm ERR! isolated-vm@4.6.0 install: prebuild-install || (node-gyp rebuild --release -j 4 && node-gyp clean)
54.53 npm ERR! Exit status 1
54.53 npm ERR!
54.53 npm ERR! Failed at the isolated-vm@4.6.0 install script.
54.53 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
54.56
54.56 npm ERR! A complete log of this run can be found in:
54.56 npm ERR! /root/.npm/_logs/2023-10-23T11_57_25_193Z-debug.log


failed to solve: process "/bin/sh -c npm ci --prefix=$NPM_PACKAGES" did not complete successfully: exit code: 1

@ogcyborg
Copy link

ogcyborg commented Nov 6, 2023

I use Ubuntu 22.04 and have the same problem. I tried "echo "export PYTHON=$(which python3)" >> ~/.bashrc
source ~/.zshrc", then "source ~/.zshrc" and I modified my .zshrc and set an environmental variable for PYTHON=/usr/bin/python3 but neither solved the problem.

@charlieartist
Copy link
Author

Have tried reinstalling, also installing the brew version of MongoDB. That works, but when I run npm install, still get errors. One may be telling:

npm ERR! prebuild-install warn install No prebuilt binaries found (target=21.1.0 runtime=node arch=arm64 libc= platform=darwin)

Hunch is this may be due in part to Apple Silicon.

@brendanbond
Copy link
Contributor

brendanbond commented Feb 19, 2024

@ogcyborg @rmoskal @charlieartist I've modified the Dockerfile to be much more isolated from the host machine in #1703, can you pull that branch down and let me know if you continue to see issues? Thanks

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

5 participants