Quantcast

[IPython-User] Updating required files for notebook - to get the --browser cmd line option

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[IPython-User] Updating required files for notebook - to get the --browser cmd line option

Tony Cappellini-2

I want to get this update


but don't know git.

More specifically, I don't know which other iPython files are/may be required in order for the --browser option to be fully functional.

I have 0.12 installed, but the --browser feature was added later than 0.12

What do I need to do to get this new feature (while hopefully not introducing any new problems in my iPython installation on OSX)?

Thanks 

_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updating required files for notebook - to get the --browser cmd line option

Thomas Kluyver-2
On 12 March 2012 06:04, Tony Cappellini <[hidden email]> wrote:
What do I need to do to get this new feature (while hopefully not introducing any new problems in my iPython installation on OSX)?

The simplest thing to do is just to run the development version - we do most development in feature branches, so master is fairly stable. If you "git clone git://github.com/ipython/ipython.git", then run "python setup.py install" inside that folder, you'll get the latest version. To update, "git pull" and install again.

Thanks,
Thomas

_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updating required files for notebook - to get the --browser cmd line option

Tony Cappellini-2
Date: Mon, 12 Mar 2012 09:26:49 +0000
From: Thomas Kluyver <[hidden email]>
Subject: Re: [IPython-User] Updating required files for notebook - to
       get the --browser cmd line option
To: "Discussions about using IPython. http://ipython.org"
       <[hidden email]>

>>The simplest thing to do is just to run the development version - we do
>>most development in feature branches, so master is fairly stable. If you
>>"git clone git://github.com/ipython/ipython.git", then run "python setup.py
>>install" inside that folder, you'll get the latest version. To update, "git
>>pull" and install again.

Thanks Thomas!
This mostly worked. That is- I got the update, installed it (had to as sudo).

When I tried launching ipython notebook --browser=chrome ...

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/Current/bin/ipython", line 7, in <module>
    launch_new_instance()
  File "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/site-packages/IPython/frontend/terminal/ipapp.py", line 409, in launch_new_instance
    app.start()
  File "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/site-packages/IPython/frontend/terminal/ipapp.py", line 379, in start
    return self.subapp.start()
  File "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/site-packages/IPython/frontend/html/notebook/notebookapp.py", line 481, in start
    browser = webbrowser.get(self.browser)
  File "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/webbrowser.py", line 52, in get
    raise Error("could not locate runnable browser")
Error: could not locate runnable browser

This isn't really an iPython issue any more. But for those who do use Chrome with the notebook...

(I do have chrome installed on my system.)
Is chrome "known to the system" by a slightly different name?

Thanks!

_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updating required files for notebook - to get the --browser cmd line option

Fernando Perez
On Tue, Mar 13, 2012 at 10:49 PM, Tony Cappellini <[hidden email]> wrote:
>
> (I do have chrome installed on my system.)
> Is chrome "known to the system" by a slightly different name?

You can try the --no-browser flag so it doesn't attempt to run the
browser for you.

Cheers,

f
_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updating required files for notebook - to get the --browser cmd line option

Paul Ivanov
In reply to this post by Tony Cappellini-2
Tony Cappellini, on 2012-03-13 22:49,  wrote:
> When I tried launching ipython notebook --browser=chrome ...
>
> Traceback (most recent call last):
...

Try this: BROWSER=google-chrome ipython notebook
 
> This isn't really an iPython issue any more. But for those who do use
> Chrome with the notebook...
>
> (I do have chrome installed on my system.)
> Is chrome "known to the system" by a slightly different name?

I'm looking into what might be going on here - I seem to remember
being able to use --browser - but I'm currently seeing the same
error as you for chrome - though it works for firefox. This is
likely because python standard library webbrowser module
registers firefox itself if it can find it.

The BROWSER environment variable (as documented in the --browser
help string) works for everything, at the moment

best,
--
Paul Ivanov
314 address only used for lists,  off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7
_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updating required files for notebook - to get the --browser cmd line option

Tony Cappellini-2
In reply to this post by Thomas Kluyver-2
>>Try this: BROWSER=google-chrome ipython notebook
This didn't cause any errors or tracebacks, but chrome did NOT get launched.
The iPython server did startup though.

>>likely because python standard library webbrowser module
>>registers firefox itself if it can find it.
Oddly enough, the webbrowser modele for Python 2.72 does not have an entry from Chrome. It does have entries for all other browsers none to mankind though.

>>The BROWSER environment variable (as documented in the --browser
>>help string) works for everything, at the moment
It works partially for me. No errors are displayed, but chrome doesn't get launched.

Thanks


_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updating required files for notebook - to get the --browser cmd line option

Thomas Kluyver-2
On 14 March 2012 18:15, Tony Cappellini <[hidden email]> wrote:
>>Try this: BROWSER=google-chrome ipython notebook
This didn't cause any errors or tracebacks, but chrome did NOT get launched.
The iPython server did startup though.

Does google-chrome at a command line successfully start chrome?

Thomas

_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updating required files for notebook - to get the --browser cmd line option

Tony Cappellini-2
In reply to this post by Thomas Kluyver-2


>>Does google-chrome at a command line successfully start chrome?

>>Thomas


No.
I have to do open "/Applications/Google Chrome.app".
This is the only way I can launch chrome from the cmd line (without iPython)


I don't know where "google-chrome" came from.
I used find to look for chrome, Chrome, google-chrome (and other spellings).
They are nowhere to be found on my MBP.

The only file that will launch chrome is Google Chrome.app

However, when I tried this

ipython notebook "/Applications/Google Chrome.app"

safari still gets launched for the notebook.



_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updating required files for notebook - to get the --browser cmd line option

Thomas Kluyver-2
On 15 March 2012 15:34, Tony Cappellini <[hidden email]> wrote:
> I don't know where "google-chrome" came from.

I think it's the command line to start chrome on Linux. BROWSER needs
to be set to an executable that will start the browser, as far as I
know. You might try setting it to /Applications/Google Chrome.app ,
but I don't know if Macs work that way.

Thomas
_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updating required files for notebook - to get the --browser cmd line option

Tony Cappellini-2

I have to put quotes around the path to the app for the open command,
so I did the same for  BROWSER=
If I don't use quotes, "Crhome.app" cannot be found, because of the space.

BROWSER="/Applications/Google Chrome.app" ipython notebook
The server was started, but no browser was launched.


On Thu, Mar 15, 2012 at 8:39 AM, Thomas Kluyver <[hidden email]> wrote:
On 15 March 2012 15:34, Tony Cappellini <[hidden email]> wrote:
> I don't know where "google-chrome" came from.

I think it's the command line to start chrome on Linux. BROWSER needs
to be set to an executable that will start the browser, as far as I
know. You might try setting it to /Applications/Google Chrome.app ,
but I don't know if Macs work that way.

Thomas


_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updating required files for notebook - to get the --browser cmd line option

Thomas Kluyver-2
Alright, what about if you put a shell script on your path which runs
"open /Applications/Google Chrome.app", then set BROWSER to the name
of that?

Thomas

On 15 March 2012 16:12, Tony Cappellini <[hidden email]> wrote:

>
> I have to put quotes around the path to the app for the open command,
> so I did the same for  BROWSER=
> If I don't use quotes, "Crhome.app" cannot be found, because of the space.
>
> BROWSER="/Applications/Google Chrome.app" ipython notebook
> The server was started, but no browser was launched.
>
>
> On Thu, Mar 15, 2012 at 8:39 AM, Thomas Kluyver <[hidden email]> wrote:
>>
>> On 15 March 2012 15:34, Tony Cappellini <[hidden email]> wrote:
>> > I don't know where "google-chrome" came from.
>>
>> I think it's the command line to start chrome on Linux. BROWSER needs
>> to be set to an executable that will start the browser, as far as I
>> know. You might try setting it to /Applications/Google Chrome.app ,
>> but I don't know if Macs work that way.
>>
>> Thomas
>
>
_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updating required files for notebook - to get the --browser cmd line option

Tony Cappellini-2
I can do that- But I'm curious as to how everyone else does this, without all the trouble that I'm seeing.


On Thu, Mar 15, 2012 at 9:49 AM, Thomas Kluyver <[hidden email]> wrote:
Alright, what about if you put a shell script on your path which runs
"open /Applications/Google Chrome.app", then set BROWSER to the name
of that?

Thomas

On 15 March 2012 16:12, Tony Cappellini <[hidden email]> wrote:
>
> I have to put quotes around the path to the app for the open command,
> so I did the same for  BROWSER=
> If I don't use quotes, "Crhome.app" cannot be found, because of the space.
>
> BROWSER="/Applications/Google Chrome.app" ipython notebook
> The server was started, but no browser was launched.
>
>
> On Thu, Mar 15, 2012 at 8:39 AM, Thomas Kluyver <[hidden email]> wrote:
>>
>> On 15 March 2012 15:34, Tony Cappellini <[hidden email]> wrote:
>> > I don't know where "google-chrome" came from.
>>
>> I think it's the command line to start chrome on Linux. BROWSER needs
>> to be set to an executable that will start the browser, as far as I
>> know. You might try setting it to /Applications/Google Chrome.app ,
>> but I don't know if Macs work that way.
>>
>> Thomas
>
>


_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updating required files for notebook - to get the --browser cmd line option

Thomas Kluyver-2
On 15 March 2012 16:51, Tony Cappellini <[hidden email]> wrote:
> I can do that- But I'm curious as to how everyone else does this, without
> all the trouble that I'm seeing.

The webbrowser module knows various tricks to launch browsers on
different systems. I think it's just having trouble handling your
particular case (launch a non-default browser that doesn't have an
executable name to run).

Thomas
_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
epi
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updating required files for notebook - to get the --browser cmd line option

epi
try :

BROWSER=/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome ipython notebook

the '\' is to escape the space, on osx the executable is usually located in "/Application/name.app/Contents/MacOS/executable"

--Massimo.


Il giorno Mar 15, 2012, alle ore 1:01 PM, Thomas Kluyver ha scritto:

> On 15 March 2012 16:51, Tony Cappellini <[hidden email]> wrote:
>> I can do that- But I'm curious as to how everyone else does this, without
>> all the trouble that I'm seeing.
>
> The webbrowser module knows various tricks to launch browsers on
> different systems. I think it's just having trouble handling your
> particular case (launch a non-default browser that doesn't have an
> executable name to run).
>
> Thomas
> _______________________________________________
> IPython-User mailing list
> [hidden email]
> http://mail.scipy.org/mailman/listinfo/ipython-user

_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Updating required files for notebook - to get the --browser cmd line option

Tony Cappellini-2


>>BROWSER=/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome ipython notebook

That works just fine. Chrome actually was launched with the notebook.

Thanks!

My friend who wanted this capability will be happy now.



the '\' is to escape the space, on osx the executable is usually located in "/Application/name.app/Contents/MacOS/executable"

--Massimo.


Il giorno Mar 15, 2012, alle ore 1:01 PM, Thomas Kluyver ha scritto:

> On 15 March 2012 16:51, Tony Cappellini <[hidden email]> wrote:
>> I can do that- But I'm curious as to how everyone else does this, without
>> all the trouble that I'm seeing.
>
> The webbrowser module knows various tricks to launch browsers on
> different systems. I think it's just having trouble handling your
> particular case (launch a non-default browser that doesn't have an
> executable name to run).
>
> Thomas
> _______________________________________________
> IPython-User mailing list
> [hidden email]
> http://mail.scipy.org/mailman/listinfo/ipython-user



_______________________________________________
IPython-User mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-user
Loading...