alibaba / pipcook

Machine learning platform for Web developers

Home Page:https://alibaba.github.io/pipcook/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: Boa install fails when npm installing in a folder name that contains a space

smithb1994 opened this issue · comments

As the title says, error occurs when npm installing @pipcook/boa in a folder name that contains a space.

Here's the error leading up to it when folder name is test 1:

npm ERR! code 1
npm ERR! path /home/anon/Desktop/test 1/node_modules/@pipcook/boa
npm ERR! command failed
npm ERR! command sh -c /tmp/preinstall678932627.sh
npm ERR! sh "command -v rm"
npm ERR! /bin/rm
npm ERR! sh "command -v make"
npm ERR! /usr/bin/make
npm ERR! sh "command -v tar"
npm ERR! /bin/tar
npm ERR! sh "command -v wget"
npm ERR! /usr/bin/wget
npm ERR! make: Entering directory '/home/anon/Desktop/test 1/node_modules/@pipcook/boa/pybind11'
npm ERR! rm -rf "/home/anon/Desktop/test 1/node_modules/@pipcook/boa/pybind11/src"
npm ERR! mkdir -p "/home/anon/Desktop/test 1/node_modules/@pipcook/boa/pybind11/downloads"
npm ERR! [ -f "/home/anon/Desktop/test 1/node_modules/@pipcook/boa/pybind11/downloads/pybind11-v2.4.3.tgz" ] || wget -O "/home/anon/Desktop/test 1/node_modules/@pipcook/boa/pybind11/downloads/pybind11-v2.4.3.tgz" https://github.com/pybind/pybind11/archive/v2.4.3.tar.gz
npm ERR! md5sum --quiet --check checksums
npm ERR! tar -C "/home/anon/Desktop/test 1/node_modules/@pipcook/boa/pybind11/downloads" -xf "/home/anon/Desktop/test 1/node_modules/@pipcook/boa/pybind11/downloads/pybind11-v2.4.3.tgz"
npm ERR! mv "/home/anon/Desktop/test 1/node_modules/@pipcook/boa/pybind11/downloads/pybind11-2.4.3" "/home/anon/Desktop/test 1/node_modules/@pipcook/boa/pybind11/src"
npm ERR! # apply patches
npm ERR! patch -u -b src/include/pybind11/pytypes.h -i patches/2.4.3-fix-object-destruct.patch
npm ERR! patching file src/include/pybind11/pytypes.h
npm ERR! rm -rf "/home/anon/Desktop/test 1/node_modules/@pipcook/boa/pybind11/src"
npm ERR! mkdir -p "/home/anon/Desktop/test 1/node_modules/@pipcook/boa/pybind11/downloads"
npm ERR! [ -f "/home/anon/Desktop/test 1/node_modules/@pipcook/boa/pybind11/downloads/pybind11-v2.4.3.tgz" ] || wget -O "/home/anon/Desktop/test 1/node_modules/@pipcook/boa/pybind11/downloads/pybind11-v2.4.3.tgz" https://github.com/pybind/pybind11/archive/v2.4.3.tar.gz
npm ERR! md5sum --quiet --check checksums
npm ERR! tar -C "/home/anon/Desktop/test 1/node_modules/@pipcook/boa/pybind11/downloads" -xf "/home/anon/Desktop/test 1/node_modules/@pipcook/boa/pybind11/downloads/pybind11-v2.4.3.tgz"
npm ERR! mv "/home/anon/Desktop/test 1/node_modules/@pipcook/boa/pybind11/downloads/pybind11-2.4.3" "/home/anon/Desktop/test 1/node_modules/@pipcook/boa/pybind11/src"
npm ERR! # apply patches
npm ERR! patch -u -b src/include/pybind11/pytypes.h -i patches/2.4.3-fix-object-destruct.patch
npm ERR! patching file src/include/pybind11/pytypes.h
npm ERR! make: Leaving directory '/home/anon/Desktop/test 1/node_modules/@pipcook/boa/pybind11'
npm ERR! sh "curl https://repo.anaconda.com/miniconda/Miniconda3-4.7.12.1-Linux-x86_64.sh > Miniconda3-4.7.12.1-Linux-x86_64.sh"
npm ERR! sh "rm -rf /home/anon/Desktop/test 1/node_modules/@pipcook/boa/.miniconda"
npm ERR! sh "sh ./Miniconda3-4.7.12.1-Linux-x86_64.sh -f -b -p /home/anon/Desktop/test 1/node_modules/@pipcook/boa/.miniconda"
npm ERR! ERROR: did not recognize option '1/node_modules/@pipcook/boa/.miniconda', please try -h

@smithb1994 What's the platform that you did install?

Linux Ubuntu Focal 20.4

I think the problem is with this line: https://github.com/imgcook/boa/blob/main/tools/install-python.js#L31

  run('sh', downloader, `-f -b -p "${installDir}"`);

The above would address this issue.

I will fix it today, @smithb1994 thanks for your feedback.

Sorry @smithb1994, Boa depends on the Miniconda3-4.7.12.1 which doesn't support installing on a folder with spaces:

case "$PREFIX" in
    *\ * )
        printf "ERROR: Cannot install into directories with spaces\\n" >&2
        exit 1
        ;;
esac

You have to remove the spaces from the directory.