You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, Probably the answer is simple :) I'm trying to run in Alpine Linux to install a package and get a permission denied errno 13.
Oddly, some packages install ok, and some have the permission denied. For example if you use this to install the requests module, it works. The python error suggest adding the --user flag, but that doesn't help here.
Here's how to produce it:
# start up docker alpine + node
docker run --rm -it node:18-alpine /bin/sh
# start a project
mkdir test&&cdtest&& npm init -y && npm i python-shell
# install python and pip
apk add python3
apk add py3-pip
# make a script
cat > index.js<<EOFconst { PythonShell } = require('python-shell');PythonShell.defaultOptions = {};const options = { mode: 'text', args: ['pip', 'install', 'pandas'], pythonOptions: ['-u'], env: { PYCHARM_HOSTED: 1 },};try { PythonShell.getVersionSync(); PythonShell.run('-m', options, function (error, results) { if (error) throw error; console.log(results.join('\n')); });} catch(e) { console.log(e); process.exit(1)}EOF# run the script
node ./index.js
You can run python3 -m pip install pandas from the terminal without problem.
I suppose it is doing something in system folder.
Here's the error:
/test # node ./index.js
/test/index.js:15
if (error) throw error;
^
PythonShellError: ERROR: Error [Errno 13] Permission denied: ''while executing command pip subprocess to install build dependencies
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: ''
Consider using the `--user` option or check the permissions.
at PythonShell.parseError (/test/node_modules/python-shell/index.js:303:21)
at terminateIfNeeded (/test/node_modules/python-shell/index.js:190:32)
at ChildProcess.<anonymous> (/test/node_modules/python-shell/index.js:182:13)
at ChildProcess.emit (node:events:537:28)
at ChildProcess._handle.onexit (node:internal/child_process:291:12) {
executable: 'python3',
options: [ '-u' ],
script: '-m',
args: [ 'pip', 'install', 'pandas' ],
exitCode: 1
}
Node.js v18.4.0
Activity
Almenon commentedon Sep 27, 2022
This is very weird... Good find, not sure what's up with this.
Pandas is failing to install even with just python inside that docker image, do you have any other libraries that can be used to reproduce this error?
christopherpickering commentedon Sep 27, 2022
@Almenon not offhand, I just picked a couple of the top librarys to test.