Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Error while trying to download Jupyter-PHP dependencies when PATH includes a space #20

Open
tdmalone opened this issue Sep 23, 2018 · 8 comments

Comments

@tdmalone
Copy link

tdmalone commented Sep 23, 2018

Hi there!

Brand new to Jupyter, and thought I'd give this a crack. I'm having trouble with the installation though.. I was wondering if you could help shed some light and/or advise on the best debugging steps?

I'm on MacOS 10.31.6.

$ php ./jupyter-php-installer.phar install
sh: Studio: command not found
sh: Studio: command not found
sh: Studio: command not found
ERROR: Error while trying to download Jupyter-PHP dependencies with Composer.

$ php ./jupyter-php-installer.phar install -vvv
sh: Studio: command not found
sh: Studio: command not found

sh: Studio: command not found

ERROR: Error while trying to download Jupyter-PHP dependencies with Composer.

Some versions...

$ php ./jupyter-php-installer.phar --version
Jupyter-PHP Installer 0.2

$ bash --version
GNU bash, version 4.4.23(1)-release (x86_64-apple-darwin17.5.0)

$ php --version
PHP 7.2.8 (cli) (built: Jul 19 2018 12:15:24) ( NTS )

$ composer --version
Composer version 1.6.5 2018-05-04 11:44:59

$ jupyter --version
4.4.0

$ php -i | grep -i zmq
zmq
ZMQ extension => enabled
ZMQ extension version => 1.1.3
libzmq version => 4.2.5
@castarco
Copy link
Contributor

Hmm... this could be a bug... has MacOs the command command? ( I'm not joking 😅 )

@castarco castarco changed the title Error while trying to download Jupyter-PHP dependencies with Composer Error while trying to download Jupyter-PHP dependencies with Composer (MacOs) Sep 23, 2018
@castarco castarco changed the title Error while trying to download Jupyter-PHP dependencies with Composer (MacOs) (MacOs) Error while trying to download Jupyter-PHP dependencies with Composer Sep 23, 2018
@castarco
Copy link
Contributor

castarco commented Sep 23, 2018

I think the bug could be here: https://github.com/Litipk/Jupyter-PHP-Installer/blob/master/src/System/UnixSystem.php#L46 , but I don't have a Mac, so I can't really test it.

@tdmalone
Copy link
Author

command should be all good... the syntax highlighting in my original post was probably a little confusing 😛

$ command -v composer && echo $?
/usr/local/bin/composer
0
$ command -v whoami && echo $?
/usr/bin/whoami
0

Studio isn't a valid command though - but I can't see where this is being called...

@tdmalone
Copy link
Author

tdmalone commented Sep 26, 2018

Ok, I found the problem. Studio comes from my PATH, which includes the path /Applications/Visual Studio Code.app/Contents/Resources/app/bin.

Because Jupyter-PHP-Installer is printing out the contents of the PATH variable before the composer init & install commands, the shell is expecting PATH to end at - in my case - '.../Visual', and then is trying to run 'Studio' as a command.

I adjusted my PATH to remove this path, and the installer succeeded.

I think the fix is probably to output quotes around the value of getenv('PATH') in https://github.com/Litipk/Jupyter-PHP-Installer/blob/master/src/Installer/Installer.php#L129.

@tdmalone tdmalone changed the title (MacOs) Error while trying to download Jupyter-PHP dependencies with Composer Error while trying to download Jupyter-PHP dependencies when PATH includes a space Sep 26, 2018
@brehar
Copy link

brehar commented Nov 26, 2018

Figuring this out gave me quite the headache, I've got to tell you. It took me a while just to finally stumble upon someone having this problem recently (and with everything properly installed).

But easy fix: Just set your path for the session (which will not be permanent), and run the .phar installer. Easy once I knew what the bug was ;)

@thestud
Copy link

thestud commented Nov 21, 2019

Set your path to what to fix it?

@gohada
Copy link

gohada commented Oct 21, 2020

sudo nano /etc/paths

@ikingye
Copy link

ikingye commented Jun 27, 2021

Set your path to what to fix it?

echo $PATH

find The blank space and remove them.

For example, the path is "/x/bin:/y/bin:/z/foo bar/bin",
you can set the path temporary by
export path="/x/bin:/y/bin" (just remove the blank space one).

Then you run php jupyter-php-installer.phar install -n -vvv

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

No branches or pull requests

6 participants