Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Cannot install with python3 #680

Open
jgrammen-agilitypr opened this issue Apr 8, 2021 · 3 comments
Open

Cannot install with python3 #680

jgrammen-agilitypr opened this issue Apr 8, 2021 · 3 comments

Comments

@jgrammen-agilitypr
Copy link

attempts to install konga using python 3

it fails during the running on npm install
it seems to fail on the attempted compilation of node-sass

First attempt

 node-sass@4.14.0 postinstall /opt/konga/node_modules/node-sass
> node scripts/build.js

Building: /usr/bin/node /opt/konga/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/bin/node',
gyp verb cli   '/opt/konga/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.8.0
gyp info using node@12.22.1 | 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 (/opt/konga/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/opt/konga/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/opt/konga/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /opt/konga/node_modules/which/which.js:89:16
gyp verb `which` failed     at /opt/konga/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /opt/konga/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:168:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (/opt/konga/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/opt/konga/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/opt/konga/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /opt/konga/node_modules/which/which.js:89:16
gyp verb `which` failed     at /opt/konga/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /opt/konga/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:168: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 (/opt/konga/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/opt/konga/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/opt/konga/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /opt/konga/node_modules/which/which.js:89:16
gyp verb `which` failed     at /opt/konga/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /opt/konga/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:168:21)
gyp verb `which` failed  python Error: not found: python
gyp verb `which` failed     at getNotFoundError (/opt/konga/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/opt/konga/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/opt/konga/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /opt/konga/node_modules/which/which.js:89:16
gyp verb `which` failed     at /opt/konga/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /opt/konga/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:168: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 (/opt/konga/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/opt/konga/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack     at F (/opt/konga/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/opt/konga/node_modules/which/which.js:80:29)
gyp ERR! stack     at /opt/konga/node_modules/which/which.js:89:16
gyp ERR! stack     at /opt/konga/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /opt/konga/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:168:21)
gyp ERR! System Linux 5.4.0-1009-aws
gyp ERR! command "/usr/bin/node" "/opt/konga/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /opt/konga/node_modules/node-sass
gyp ERR! node -v v12.22.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.14.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.14.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-04-08T20_06_15_281Z-debug.log

it cannot find python because i have python3 installed
so install
sudo apt-get install python-is-python3

then try again

Building: /usr/bin/node /opt/konga/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/bin/node',
gyp verb cli   '/opt/konga/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.8.0
gyp info using node@12.22.1 | 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 (/opt/konga/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/opt/konga/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/opt/konga/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /opt/konga/node_modules/which/which.js:89:16
gyp verb `which` failed     at /opt/konga/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /opt/konga/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:168:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (/opt/konga/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/opt/konga/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/opt/konga/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /opt/konga/node_modules/which/which.js:89:16
gyp verb `which` failed     at /opt/konga/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /opt/konga/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:168: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` succeeded python /usr/bin/python
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /usr/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                       ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:308:12)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at maybeClose (internal/child_process.js:1022:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
gyp ERR! System Linux 5.4.0-1009-aws
gyp ERR! command "/usr/bin/node" "/opt/konga/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /opt/konga/node_modules/node-sass
gyp ERR! node -v v12.22.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.14.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.14.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-04-08T20_07_40_443Z-debug.log

Still fails and appears not to work with python 3

Googling results in
sass/node-sass#2877

and the following warning
https://www.npmjs.com/package/node-sass?activeTab=readme

Warning: LibSass and Node Sass are deprecated. While they will continue to receive maintenance releases indefinitely, there are no plans to add additional features or compatibility with any new CSS or Sass features. Projects that still use it should move onto Dart Sass.

snipet of log

1280 27438 verbose stack Error: node-sass@4.14.0 postinstall: `node scripts/build.js`
11281 27438 verbose stack Exit status 1
11282 27438 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
11283 27438 verbose stack     at EventEmitter.emit (events.js:314:20)
11284 27438 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
11285 27438 verbose stack     at ChildProcess.emit (events.js:314:20)
11286 27438 verbose stack     at maybeClose (internal/child_process.js:1022:16)
11287 27438 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
11288 27439 verbose pkgid node-sass@4.14.0
11289 27440 verbose cwd /opt/konga
11290 27441 verbose Linux 5.4.0-1009-aws
11291 27442 verbose argv "/usr/bin/node" "/usr/bin/npm" "install"
11292 27443 verbose node v12.22.1
11293 27444 verbose npm  v6.14.12
11294 27445 error code ELIFECYCLE
11295 27446 error errno 1
11296 27447 error node-sass@4.14.0 postinstall: `node scripts/build.js`
11297 27447 error Exit status 1
11298 27448 error Failed at the node-sass@4.14.0 postinstall script.
11299 27448 error This is probably not a problem with npm. There is likely additional logging output above
@jgrammen-agilitypr
Copy link
Author

I have made a pull request for a potential fix for the python 3 issue, by swapping node-sass (deprecated) to sass.

@shub-ham
Copy link

I have made a pull request for a potential fix for the python 3 issue, by swapping node-sass (deprecated) to sass.

Hello can you please share where & all we need to swap node-sass with sass ? to install using python 3.

@jgrammen-agilitypr
Copy link
Author

Check the commit / pull request I made, you can see the changes:
622267d

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

No branches or pull requests

2 participants