Hi Samuel,

Thank you for this. One thing: I made a mistake in my comments on 
ask.sagemath.org. Changing sys.path changes the Python path, not the path 
for executables. One option is to use

    import os; os.environ["PATH"] += ":/usr/local/bin"

Any better ways to do this? Your pointer on how to include this into 
IPython config files works, as long as the lines are in quotes:

c.InteractiveShellApp.exec_lines = [
    'import os; os.environ["PATH"] += ":/usr/local/bin" ']



On Friday, June 24, 2022 at 10:09:39 AM UTC-7 slelievre wrote:

> 2022-06-22 16:37:11 UTC, John H Palmieri:
> >
> > How do I set the PATH in the OS X Jupyter notebook,
> > if I'm using the 3-manifolds binary app? I mean, I know
> > how to do it in an individual notebook, but how do I set
> > the default PATH for every notebook? For example,
> > how do I add /usr/local/bin so that it's in the PATH
> > every time I open a new notebook?
>
> Hi John,
>
> Good job with your comments at
>
> - Ask Sage question 62873
>   https://ask.sagemath.org/question/62873
>   Animating plots in Jupyter/Sagemath
>
> Here is a possibility for the missing bit, after reading
>
> - discussion at [Stack Overflow question 34976803](
> https://stackoverflow.com/q/34976803)
> - [Lucy Park: When Python imports but IPython does not](
> https://www.lucypark.kr/blog/2013/02/10/when-python-imports-and-ipython-does-not/
> )
>
> To define some code to be run at the start of each
> Sage session, and/or each time the Sage Jupyter
> kernel starts, edit one or both of the files
>
> - `$HOME/.sage/ipython-5.0.0/profile_default/ipython_config.py`
> - `$HOME/.sage/ipython-5.0.0/profile_default/ipython_kernel_config.py`
>
> in which you should find a section like this:
>
>     ## lines of code to run at IPython startup.
>     #  Default: []
>     # c.InteractiveShellApp.exec_lines = []
>
> Uncomment the last line in that section and add
> any code to run. For example:
>
>     ## lines of code to run at IPython startup.
>     #  Default: []
>     c.InteractiveShellApp.exec_lines = [
>         import sys; sys.path.append('/usr/local/bin')
>     ]
>  
> Feel free to consolidate your comments and this idea
> into an answer to the Ask Sage question.   --Samuel
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/b25491b0-c599-46cf-99d2-02627b368104n%40googlegroups.com.

Reply via email to