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

failed Error: not found: python2 #2175

Closed
Sogl opened this issue Jun 17, 2019 · 5 comments
Closed

failed Error: not found: python2 #2175

Sogl opened this issue Jun 17, 2019 · 5 comments
Labels

Comments

@Sogl
Copy link
Contributor

Sogl commented Jun 17, 2019

Info:

  • Docker version ($ docker --version): 18.09.2, build 6247962
  • Laradock commit ($ git rev-parse HEAD): 63fc1fd (v. 7.15)
  • System info (Mac, PC, Linux): Mac OS Sierra 10.12.6
  • System info disto/version:

Issue:

When I tried to use yarn I see this error:

laradock@5495cb24f7b6:/var/www/blender$ yarn
yarn install v1.16.0
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.1.3: The platform "linux" is incompatible with this module.
info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[6/6] ⠈ node-sass
[-/6] ⠈ waiting...
[3/6] ⠈ mozjpeg
[-/6] ⠈ waiting...
error /var/www/blender/node_modules/node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments: 
Directory: /var/www/blender/node_modules/node-sass
Output:
Building: /home/laradock/.nvm/versions/node/v12.4.0/bin/node /var/www/blender/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   '/home/laradock/.nvm/versions/node/v12.4.0/bin/node',
gyp verb cli   '/var/www/blender/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 node-gyp@3.6.2
gyp info using node@12.4.0 | 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 (/var/www/blender/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/var/www/blender/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/var/www/blender/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /var/www/blender/node_modules/which/which.js:89:16
gyp verb `which` failed     at /var/www/blender/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /var/www/blender/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:165:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (/var/www/blender/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/var/www/blender/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/var/www/blender/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /var/www/blender/node_modules/which/which.js:89:16
gyp verb `which` failed     at /var/www/blender/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /var/www/blender/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:165:21) {
gyp verb `which` failed   stack: 'Error: not found: python2\n    at getNotFoundError ' +
gyp verb `which` failed     '(/var/www/blender/node_modules/which/which.js:13:12)\n    at F ' +
gyp verb `which` failed     '(/var/www/blender/node_modules/which/which.js:68:19)\n    at E ' +
gyp verb `which` failed     '(/var/www/blender/node_modules/which/which.js:80:29)\n    at ' +
gyp verb `which` failed     '/var/www/blender/node_modules/which/which.js:89:16\n    at ' +
gyp verb `which` failed     '/var/www/blender/node_modules/isexe/index.js:42:5\n    at ' +
gyp verb `which` failed     '/var/www/blender/node_modules/isexe/mode.js:8:5\n    at ' +
gyp verb `which` failed     'FSReqCallback.oncomplete (fs.js:165: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 (/var/www/blender/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/var/www/blender/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/var/www/blender/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /var/www/blender/node_modules/which/which.js:89:16
gyp verb `which` failed     at /var/www/blender/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /var/www/blender/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:165:21)
gyp verb `which` failed  python Error: not found: python
gyp verb `which` failed     at getNotFoundError (/var/www/blender/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/var/www/blender/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/var/www/blender/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /var/www/blender/node_modules/which/which.js:89:16
gyp verb `which` failed     at /var/www/blender/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /var/www/blender/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:165:21) {
gyp verb `which` failed   stack: 'Error: not found: python\n    at getNotFoundError ' +
gyp verb `which` failed     '(/var/www/blender/node_modules/which/which.js:13:12)\n    at F ' +
gyp verb `which` failed     '(/var/www/blender/node_modules/which/which.js:68:19)\n    at E ' +
gyp verb `which` failed     '(/var/www/blender/node_modules/which/which.js:80:29)\n    at ' +
gyp verb `which` failed     '/var/www/blender/node_modules/which/which.js:89:16\n    at ' +
gyp verb `which` failed     '/var/www/blender/node_modules/isexe/index.js:42:5\n    at ' +
gyp verb `which` failed     '/var/www/blender/node_modules/isexe/mode.js:8:5\n    at ' +
gyp verb `which` failed     'FSReqCallback.oncomplete (fs.js:165: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 (/var/www/blender/node_modules/node-gyp/lib/configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/var/www/blender/node_modules/node-gyp/lib/configure.js:397:16)
gyp ERR! stack     at F (/var/www/blender/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/var/www/blender/node_modules/which/which.js:80:29)
gyp ERR! stack     at /var/www/blender/node_modules/which/which.js:89:16
gyp ERR! stack     at /var/www/blender/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /var/www/blender/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:165:21)
gyp ERR! System Linux 4.9.125-linuxkit
gyp ERR! command "/home/laradock/.nvm/versions/node/v12.4.0/bin/node" "/var/www/blender/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /var/www/blender/node_modules/node-sass
gyp ERR! node -v v12.4.0

I see that python3 command is exist in PATH and working, but no command for python2 or python2.7.

I also found some issues and PRs but nothing works for now:
#1238 (2017 year conversation about problem)
#1240 (add python2.7 lines)
#1257 (remove lines 😄 )

Expected behavior:

python2.7 is installed and python or python2 commands works.

Reproduce:

Try to install Laravel bolerplate: https://github.com/spatie/blender frontend with yarn command.

@Sogl
Copy link
Contributor Author

Sogl commented Jun 17, 2019

Also I found similar issue from another repository: nodejs/docker-node#384
Maybe I can add few lines from there Dockerfile to fix?

@Sogl
Copy link
Contributor Author

Sogl commented Jun 17, 2019

Ok, solved with some steps:

  1. Add python2.7 installation line to workspace/Dockerfile:
###########################################################################
# PYTHON:
###########################################################################

ARG INSTALL_PYTHON=false

RUN if [ ${INSTALL_PYTHON} = true ]; then \
  apt-get -y install python python2.7 python-pip python-dev build-essential  \
  && python -m pip install --upgrade pip  \
  && python -m pip install --upgrade virtualenv \
;fi
  1. Rebuild workspace container without cache (I tried with cache before with no luck): docker-compose build --no-cache workspace
  2. Up the new container: docker-compose up workspace

Logs:

MacBook-Pro-Artem:laradock artyom$  docker-compose up workspace
laradock_docker-in-docker_1 is up-to-date
Recreating laradock_workspace_1 ... done
Attaching to laradock_workspace_1

I don't know how it works, but this step solved my another problem with downgrade MySQL from latest to 5.7. I think it recreate links/relations with docker-in-docker main container and rebuilded container.

  1. Ctrl + C to Abort. Container is still works.
  2. Profit. You can now login as root with docker-compose exec workspace bash or with laradock user docker-compose exec --user=laradock workspace bash and python command works!

@stale
Copy link

stale bot commented Feb 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Feb 2, 2020
@stale
Copy link

stale bot commented Feb 23, 2020

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed Feb 23, 2020
@ledtest
Copy link

ledtest commented Aug 25, 2020

Ok, solved with some steps:

  1. Add python2.7 installation line to workspace/Dockerfile:
###########################################################################
# PYTHON:
###########################################################################

ARG INSTALL_PYTHON=false

RUN if [ ${INSTALL_PYTHON} = true ]; then \
  apt-get -y install python python2.7 python-pip python-dev build-essential  \
  && python -m pip install --upgrade pip  \
  && python -m pip install --upgrade virtualenv \
;fi
  1. Rebuild workspace container without cache (I tried with cache before with no luck): docker-compose build --no-cache workspace
  2. Up the new container: docker-compose up workspace

Logs:

MacBook-Pro-Artem:laradock artyom$  docker-compose up workspace
laradock_docker-in-docker_1 is up-to-date
Recreating laradock_workspace_1 ... done
Attaching to laradock_workspace_1

I don't know how it works, but this step solved my another problem with downgrade MySQL from latest to 5.7. I think it recreate links/relations with docker-in-docker main container and rebuilded container.

  1. Ctrl + C to Abort. Container is still works.
  2. Profit. You can now login as root with docker-compose exec workspace bash or with laradock user docker-compose exec --user=laradock workspace bash and python command works!

Thank you very much. Your answer solved my problem. Now node works very well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants