Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.(5)

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

ITtutoria

ITtutoria Logo ITtutoria Logo

ITtutoria Navigation

  • Python
  • Java
  • Reactjs
  • JavaScript
  • R
  • PySpark
  • MYSQL
  • Pandas
  • QA
  • C++
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Python
  • Science
  • Java
  • JavaScript
  • Reactjs
  • Nodejs
  • Tools
  • QA
Home/ Questions/How can fix the error ''error: can't find python executable "python", you can set the python env variable.''?
Answered
pete
  • 2
pete
Asked: July 2, 20222022-07-02T04:43:45+00:00 2022-07-02T04:43:45+00:00In: python

How can fix the error ”error: can’t find python executable “python”, you can set the python env variable.”?

  • 2

. Advertisement .

..3..

. Advertisement .

..4..

CircleCI is failing for me with an odd build error:

Can't find Python executable "python", you can set the PYTHON env variable

On a new commit, I spotted it. Of course, it was my new commit which I forcibly pushed my last known passing commit onto main branch.

I continue to receive the bizarre missing Python build problem when I re-un the same commit from Saturday:

Can't find Python executable "python", you can set the PYTHON env variable

Here is my circleci config file (which has not changed):

version: 2.1 # Use 2.1 to enable using orbs and other features.

# Declare the orbs that we'll use in our config.
# read more about orbs: https://circleci.com/docs/2.0/using-orbs/
orbs:
  ruby: circleci/[email protected]
  node: circleci/node@2

jobs:
  build: # our first job, named "build"
    docker:
     - image: circleci/ruby:2.7.4-node-browsers # use a tailored CircleCI docker image.
       auth:
         username: mydockerhub-user
         password: $DOCKERHUB_PASSWORD # context / project UI env-var reference
    steps:
      - checkout # pull down our git code.
      - ruby/install-deps # use the ruby orb to install dependencies
      # use the node orb to install our packages
      # specifying that we use `yarn` and to cache dependencies with `yarn.lock`
      # learn more: https://circleci.com/docs/2.0/caching/
      - node/install-packages:
          pkg-manager: yarn
          cache-key: "yarn.lock"

  test: # our next job, called "test"
    parallelism: 1
    # here we set TWO docker images.
    docker:
     - image: circleci/ruby:2.7.4-node-browsers # this is our primary docker image, where step commands run.
       auth:
         username: mydockerhub-user
         password: $DOCKERHUB_PASSWORD # context / project UI env-var reference
     - image: circleci/postgres:9.5-alpine
       auth:
         username: mydockerhub-user
         password: $DOCKERHUB_PASSWORD # context / project UI env-var reference
       environment: # add POSTGRES environment variables.
         POSTGRES_USER: circleci-demo-ruby
         POSTGRES_DB: verso-commerce-test2
         POSTGRES_PASSWORD: ""
     # environment variables specific to Ruby/Rails, applied to the primary container.
     environment:
       BUNDLE_JOBS: "3"
       BUNDLE_RETRY: "3"
       PGHOST: 127.0.0.1
       PGUSER: circleci-demo-ruby
       PGPASSWORD: ""
       RAILS_ENV: test
     # A series of steps to run, some are similar to those in "build".
     steps:
       - checkout
       - ruby/install-deps
       - node/install-packages:
           pkg-manager: yarn
           cache-key: "yarn.lock"
     # Here we make sure that the secondary container boots
     # up before we run operations on the database.
     - run:
         name: Wait for DB
         command: dockerize -wait tcp://localhost:5432 -timeout 1m
     - run:
         name: Database setup
         command: bundle exec rails db:schema:load --trace
     # Run rspec in parallel
     - ruby/rspec-test

# We use workflows to orchestrate the jobs that we declared above.
workflows:
  version: 2
  build_and_test: # The name of our workflow is "build_and_test"
    jobs: # The list of jobs we run as part of this workflow.
      - build # Run build first.
      - test: # Then run test,
          requires: # Test requires that build passes for it to run.
              - build # Finally, run the build job.

The full error is:

#!/bin/bash -eo pipefail
if [ ! -f "package.json" ]; then
  echo
  echo "---"
  echo "Unable to find your package.json file. Did you forget to set the app-dir parameter?"
  echo "---"
  echo
  echo "Current directory: $(pwd)"
  echo
  echo
  echo "List directory: "
  echo
  ls
  exit 1
fi
case yarn in
  npm)
    if [[ "false" == "true" ]]; then
      npm install
    else
      npm ci
    fi
  ;;
  yarn)
    if [[ "false" == "true" ]]; then
      yarn install
    else
      yarn install --frozen-lockfile
    fi
  ;;
esac

yarn install v1.22.15
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@babel/preset-react > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@babel/preset-react > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@babel/preset-react > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@babel/preset-react > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "@babel/preset-react > @babel/plugin-transform-react-jsx > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0".
warning " > @reactchartjs/[email protected]" has incorrect peer dependency "chart.js@^2.3".
warning " > [email protected]" has unmet peer dependency "react-is@>= 16.8.0".
warning " > [email protected]" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
warning "webpack-dev-server > [email protected]" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
[4/4] Building fresh packages...
error /home/circleci/project/node_modules/node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: /home/circleci/project/node_modules/node-sass
Output:
Building: /usr/local/bin/node /home/circleci/project/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli '/usr/local/bin/node',
gyp verb cli '/home/circleci/project/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library='
gyp verb cli ]
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed at getNotFoundError (/home/circleci/project/node_modules/which/which.js:13:12)
gyp verb `which` failed at F (/home/circleci/project/node_modules/which/which.js:68:19)
gyp verb `which` failed at E (/home/circleci/project/node_modules/which/which.js:80:29)
gyp verb `which` failed at /home/circleci/project/node_modules/which/which.js:89:16
gyp verb `which` failed at /home/circleci/project/node_modules/isexe/index.js:42:5
gyp verb `which` failed at /home/circleci/project/node_modules/isexe/mode.js:8:5
gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21)
gyp verb `which` failed python2 Error: not found: python2
gyp verb `which` failed at getNotFoundError (/home/circleci/project/node_modules/which/which.js:13:12)
gyp verb `which` failed at F (/home/circleci/project/node_modules/which/which.js:68:19)
gyp verb `which` failed at E (/home/circleci/project/node_modules/which/which.js:80:29)
gyp verb `which` failed at /home/circleci/project/node_modules/which/which.js:89:16
gyp verb `which` failed at /home/circleci/project/node_modules/isexe/index.js:42:5
gyp verb `which` failed at /home/circleci/project/node_modules/isexe/mode.js:8:5
gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21) {
gyp verb `which` failed code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed at getNotFoundError (/home/circleci/project/node_modules/which/which.js:13:12)
gyp verb `which` failed at F (/home/circleci/project/node_modules/which/which.js:68:19)
gyp verb `which` failed at E (/home/circleci/project/node_modules/which/which.js:80:29)
gyp verb `which` failed at /home/circleci/project/node_modules/which/which.js:89:16
gyp verb `which` failed at /home/circleci/project/node_modules/isexe/index.js:42:5
gyp verb `which` failed at /home/circleci/project/node_modules/isexe/mode.js:8:5
gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21)
gyp verb `which` failed python Error: not found: python
gyp verb `which` failed at getNotFoundError (/home/circleci/project/node_modules/which/which.js:13:12)
gyp verb `which` failed at F (/home/circleci/project/node_modules/which/which.js:68:19)
gyp verb `which` failed at E (/home/circleci/project/node_modules/which/which.js:80:29)
gyp verb `which` failed at /home/circleci/project/node_modules/which/which.js:89:16
gyp verb `which` failed at /home/circleci/project/node_modules/isexe/index.js:42:5
gyp verb `which` failed at /home/circleci/project/node_modules/isexe/mode.js:8:5
gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21) {
gyp verb `which` failed code: 'ENOENT'
gyp verb `which` failed }
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (/home/circleci/project/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack at PythonFinder.<anonymous> (/home/circleci/project/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack at F (/home/circleci/project/node_modules/which/which.js:68:16)
gyp ERR! stack at E (/home/circleci/project/node_modules/which/which.js:80:29)
gyp ERR! stack at /home/circleci/project/node_modules/which/which.js:89:16
gyp ERR! stack at /home/circleci/project/node_modules/isexe/index.js:42:5
gyp ERR! stack at /home/circleci/project/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqCallback.oncomplete (node:fs:198:21)
gyp ERR! System Linux 4.15.0-1110-aws
gyp ERR! command "/usr/local/bin/node" "/home/circleci/project/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/circleci/project/node_modules/node-sass
gyp ERR! node -v v16.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Exited with code exit status 1
CircleCI received exit code 1

Please give me some advice to solve this problem.

 

  • 1 1 Answer
  • 95 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook
  • Report

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Best Answer
    hdtutoria Expert
    2022-07-02T04:52:14+00:00Added an answer on July 2, 2022 at 4:52 am

    The cause: Your mistake is here:

    build:
      docker:
        - image: circleci/ruby:2.7.4-node-browsers # use a tailored CircleCI docker image.

    and

    test: # our next job, called "test"
      parallelism: 1
      # here we set TWO docker images.
      docker:
        - image: circleci/ruby:2.7.4-node-browsers # this is our primary docker image, where step commands run.

    Solution: To solve this error, you should change:

    build:
      docker:
        - image: circleci/ruby:2.7.4-node-browsers # use a tailored CircleCI docker image.

    to

    docker:
      - image: cimg/ruby:2.7.4-browsers # use a tailored CircleCI docker image.

    also changed

    test: # our next job, called "test"
      parallelism: 1
      # here we set TWO docker images.
      docker:
        - image: circleci/ruby:2.7.4-node-browsers # this is our primary docker image, where step commands run.

    to

    test: # our next job, called "test"
      parallelism: 1
      # here we set TWO docker images.
      docker:
        - image: cimg/ruby:2.7.4-browsers # this is our primary docker image, where step
    • 1
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question
  • How to Split String by space in C++
  • How To Convert A Pandas DataFrame Column To A List
  • How to Replace Multiple Characters in A String in Python?
  • How To Remove Special Characters From String Python

Explore

  • Home
  • Tutorial

Footer

ITtutoria

ITtutoria

This website is user friendly and will facilitate transferring knowledge. It would be useful for a self-initiated learning process.

@ ITTutoria Co Ltd.

Tutorial

  • Home
  • Python
  • Science
  • Java
  • JavaScript
  • Reactjs
  • Nodejs
  • Tools
  • QA

Legal Stuff

  • About Us
  • Terms of Use
  • Privacy Policy
  • Contact Us

DMCA.com Protection Status

Help

  • Knowledge Base
  • Support

Follow

© 2022 Ittutoria. All Rights Reserved.

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.