Using environment variable in jupyter_notebook_config.pyJupyter path error when on different server with mapped home directoryJupyter Notebook won't run python 3 - import pygments errorCant Launch Jupyter NotebookMigration error at startup for Jupyter Notebookjupyter notebook w/ Python - Kernel errorCan not start jupyter-notebook on remote ubuntu serverHow to run a jupyter notebook using a singularity image?ec2 ubuntu name or service unknown error when running jupyter notebookJupyter Notebook on cmdaccesing Jupyter running in AWS - getting certificate error accessing it

Is Cola "probably the best-known" Latin word in the world? If not, which might it be?

Why do money exchangers give different rates to different bills?

In Endgame, why were these characters still around?

What are the differences between credential stuffing and password spraying?

Was Unix ever a single-user OS?

Selecting a secure PIN for building access

Can I get a paladin's steed by True Polymorphing into a monster that can cast Find Steed?

Why is `abs()` implemented differently?

I caught several of my students plagiarizing. Could it be my fault as a teacher?

Do I have to make someone coauthor if he/she solves a problem in StackExchange, asked by myself, which is later used in my paper?

Why is C# in the D Major Scale?

Is there a legal ground for stripping the UK of its UN Veto if Scotland and/or N.Ireland split from the UK?

Junior developer struggles: how to communicate with management?

How to reply this mail from potential PhD professor?

I may be a fraud

Linear algebra - find dual space base

In a vacuum triode, what prevents the grid from acting as another anode?

A non-technological, repeating, phenomenon in the sky, holding its position in the sky for hours

CRT Oscilloscope - part of the plot is missing

What is the minimal installation possible in order to run a .jar Java file?

What is the unit of the area when geometry attributes are calculated in QGIS?

Is it cheaper to drop cargo than to land it?

What does a yield inside a yield do?

Are we obligated to aspire to be Talmidei Chachamim?



Using environment variable in jupyter_notebook_config.py


Jupyter path error when on different server with mapped home directoryJupyter Notebook won't run python 3 - import pygments errorCant Launch Jupyter NotebookMigration error at startup for Jupyter Notebookjupyter notebook w/ Python - Kernel errorCan not start jupyter-notebook on remote ubuntu serverHow to run a jupyter notebook using a singularity image?ec2 ubuntu name or service unknown error when running jupyter notebookJupyter Notebook on cmdaccesing Jupyter running in AWS - getting certificate error accessing it






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I want to use an environment variable as the location for the c.NotebookApp.notebook_dir parameter in jupyter_notebook_config.py but I have added



c.NotebookApp.notebook_dir = $JUPYTER_NOTEBOOKS


I have also created the variable



>export JUPYTER_NOTEBOOKS=/home/jupyter


but when I run Jupyter notebook I get the below error message and I can tell its not pulling the value of the variable and is trying to use the variable as a literal. Has anyone used environment variables successfully in jupyter notebook config?



[E 20:45:04.513 NotebookApp] Exception while loading config file /root/.jupyter/jupyter_notebook_config.py
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/traitlets/config/application.py", line 562, in _load_config_files
config = loader.load_config()
File "/usr/local/lib/python3.6/site-packages/traitlets/config/loader.py", line 457, in load_config
self._read_file_as_dict()
File "/usr/local/lib/python3.6/site-packages/traitlets/config/loader.py", line 489, in _read_file_as_dict
py3compat.execfile(conf_filename, namespace)
File "/usr/local/lib/python3.6/site-packages/ipython_genutils/py3compat.py", line 198, in execfile
exec(compiler(f.read(), fname, 'exec'), glob, loc)
File "/root/.jupyter/jupyter_notebook_config.py", line 766
c.NotebookApp.notebook_dir = $JUPYTER_NOTEBOOKS
^
SyntaxError: unexpected character after line continuation character
[I 20:45:04.523 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
Traceback (most recent call last):
File "/usr/local/bin/jupyter-notebook", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/usr/local/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance
app.initialize(argv)
File "</usr/local/lib/python3.6/site-packages/decorator.py:decorator-gen-7>", line 2, in initialize
File "/usr/local/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 1628, in initialize
self.init_webapp()
File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 1407, in init_webapp
self.http_server.listen(port, self.ip)
File "/usr/local/lib/python3.6/site-packages/tornado/tcpserver.py", line 151, in listen
sockets = bind_sockets(port, address=address)
File "/usr/local/lib/python3.6/site-packages/tornado/netutil.py", line 174, in bind_sockets
sock.bind(sockaddr)
OSError: [Errno 99] Cannot assign requested address









share|improve this question




























    1















    I want to use an environment variable as the location for the c.NotebookApp.notebook_dir parameter in jupyter_notebook_config.py but I have added



    c.NotebookApp.notebook_dir = $JUPYTER_NOTEBOOKS


    I have also created the variable



    >export JUPYTER_NOTEBOOKS=/home/jupyter


    but when I run Jupyter notebook I get the below error message and I can tell its not pulling the value of the variable and is trying to use the variable as a literal. Has anyone used environment variables successfully in jupyter notebook config?



    [E 20:45:04.513 NotebookApp] Exception while loading config file /root/.jupyter/jupyter_notebook_config.py
    Traceback (most recent call last):
    File "/usr/local/lib/python3.6/site-packages/traitlets/config/application.py", line 562, in _load_config_files
    config = loader.load_config()
    File "/usr/local/lib/python3.6/site-packages/traitlets/config/loader.py", line 457, in load_config
    self._read_file_as_dict()
    File "/usr/local/lib/python3.6/site-packages/traitlets/config/loader.py", line 489, in _read_file_as_dict
    py3compat.execfile(conf_filename, namespace)
    File "/usr/local/lib/python3.6/site-packages/ipython_genutils/py3compat.py", line 198, in execfile
    exec(compiler(f.read(), fname, 'exec'), glob, loc)
    File "/root/.jupyter/jupyter_notebook_config.py", line 766
    c.NotebookApp.notebook_dir = $JUPYTER_NOTEBOOKS
    ^
    SyntaxError: unexpected character after line continuation character
    [I 20:45:04.523 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
    Traceback (most recent call last):
    File "/usr/local/bin/jupyter-notebook", line 11, in <module>
    sys.exit(main())
    File "/usr/local/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
    File "/usr/local/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance
    app.initialize(argv)
    File "</usr/local/lib/python3.6/site-packages/decorator.py:decorator-gen-7>", line 2, in initialize
    File "/usr/local/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
    File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 1628, in initialize
    self.init_webapp()
    File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 1407, in init_webapp
    self.http_server.listen(port, self.ip)
    File "/usr/local/lib/python3.6/site-packages/tornado/tcpserver.py", line 151, in listen
    sockets = bind_sockets(port, address=address)
    File "/usr/local/lib/python3.6/site-packages/tornado/netutil.py", line 174, in bind_sockets
    sock.bind(sockaddr)
    OSError: [Errno 99] Cannot assign requested address









    share|improve this question
























      1












      1








      1








      I want to use an environment variable as the location for the c.NotebookApp.notebook_dir parameter in jupyter_notebook_config.py but I have added



      c.NotebookApp.notebook_dir = $JUPYTER_NOTEBOOKS


      I have also created the variable



      >export JUPYTER_NOTEBOOKS=/home/jupyter


      but when I run Jupyter notebook I get the below error message and I can tell its not pulling the value of the variable and is trying to use the variable as a literal. Has anyone used environment variables successfully in jupyter notebook config?



      [E 20:45:04.513 NotebookApp] Exception while loading config file /root/.jupyter/jupyter_notebook_config.py
      Traceback (most recent call last):
      File "/usr/local/lib/python3.6/site-packages/traitlets/config/application.py", line 562, in _load_config_files
      config = loader.load_config()
      File "/usr/local/lib/python3.6/site-packages/traitlets/config/loader.py", line 457, in load_config
      self._read_file_as_dict()
      File "/usr/local/lib/python3.6/site-packages/traitlets/config/loader.py", line 489, in _read_file_as_dict
      py3compat.execfile(conf_filename, namespace)
      File "/usr/local/lib/python3.6/site-packages/ipython_genutils/py3compat.py", line 198, in execfile
      exec(compiler(f.read(), fname, 'exec'), glob, loc)
      File "/root/.jupyter/jupyter_notebook_config.py", line 766
      c.NotebookApp.notebook_dir = $JUPYTER_NOTEBOOKS
      ^
      SyntaxError: unexpected character after line continuation character
      [I 20:45:04.523 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
      Traceback (most recent call last):
      File "/usr/local/bin/jupyter-notebook", line 11, in <module>
      sys.exit(main())
      File "/usr/local/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
      return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
      File "/usr/local/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance
      app.initialize(argv)
      File "</usr/local/lib/python3.6/site-packages/decorator.py:decorator-gen-7>", line 2, in initialize
      File "/usr/local/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
      return method(app, *args, **kwargs)
      File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 1628, in initialize
      self.init_webapp()
      File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 1407, in init_webapp
      self.http_server.listen(port, self.ip)
      File "/usr/local/lib/python3.6/site-packages/tornado/tcpserver.py", line 151, in listen
      sockets = bind_sockets(port, address=address)
      File "/usr/local/lib/python3.6/site-packages/tornado/netutil.py", line 174, in bind_sockets
      sock.bind(sockaddr)
      OSError: [Errno 99] Cannot assign requested address









      share|improve this question














      I want to use an environment variable as the location for the c.NotebookApp.notebook_dir parameter in jupyter_notebook_config.py but I have added



      c.NotebookApp.notebook_dir = $JUPYTER_NOTEBOOKS


      I have also created the variable



      >export JUPYTER_NOTEBOOKS=/home/jupyter


      but when I run Jupyter notebook I get the below error message and I can tell its not pulling the value of the variable and is trying to use the variable as a literal. Has anyone used environment variables successfully in jupyter notebook config?



      [E 20:45:04.513 NotebookApp] Exception while loading config file /root/.jupyter/jupyter_notebook_config.py
      Traceback (most recent call last):
      File "/usr/local/lib/python3.6/site-packages/traitlets/config/application.py", line 562, in _load_config_files
      config = loader.load_config()
      File "/usr/local/lib/python3.6/site-packages/traitlets/config/loader.py", line 457, in load_config
      self._read_file_as_dict()
      File "/usr/local/lib/python3.6/site-packages/traitlets/config/loader.py", line 489, in _read_file_as_dict
      py3compat.execfile(conf_filename, namespace)
      File "/usr/local/lib/python3.6/site-packages/ipython_genutils/py3compat.py", line 198, in execfile
      exec(compiler(f.read(), fname, 'exec'), glob, loc)
      File "/root/.jupyter/jupyter_notebook_config.py", line 766
      c.NotebookApp.notebook_dir = $JUPYTER_NOTEBOOKS
      ^
      SyntaxError: unexpected character after line continuation character
      [I 20:45:04.523 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
      Traceback (most recent call last):
      File "/usr/local/bin/jupyter-notebook", line 11, in <module>
      sys.exit(main())
      File "/usr/local/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
      return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
      File "/usr/local/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance
      app.initialize(argv)
      File "</usr/local/lib/python3.6/site-packages/decorator.py:decorator-gen-7>", line 2, in initialize
      File "/usr/local/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
      return method(app, *args, **kwargs)
      File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 1628, in initialize
      self.init_webapp()
      File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 1407, in init_webapp
      self.http_server.listen(port, self.ip)
      File "/usr/local/lib/python3.6/site-packages/tornado/tcpserver.py", line 151, in listen
      sockets = bind_sockets(port, address=address)
      File "/usr/local/lib/python3.6/site-packages/tornado/netutil.py", line 174, in bind_sockets
      sock.bind(sockaddr)
      OSError: [Errno 99] Cannot assign requested address






      jupyter-notebook






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 22 at 21:05









      Alex BrownAlex Brown

      61




      61






















          2 Answers
          2






          active

          oldest

          votes


















          0














          It isn't clear that you are using environment variables properly. I glanced at the docs and it looks like %env JUPYTER_NOTEBOOKS is the right way to do it. I checked this on my local system and it works (for a different env variable). Give that a try - good luck! :-) . Below are the docs.



          https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-env






          share|improve this answer






























            0














            Thanks jimf your link helped. I was able to get things working because I was NOT using environment variables correctly. Instead of modifying the .py file I added the parameter to my command of starting jupyter notebook like this:



            --NotebookApp.notebook_dir=$JUPYTER_NOTEBOOKS


            I was then able to change the variable value and change where jupyter was looking for notebooks.






            share|improve this answer























              Your Answer






              StackExchange.ifUsing("editor", function ()
              StackExchange.using("externalEditor", function ()
              StackExchange.using("snippets", function ()
              StackExchange.snippets.init();
              );
              );
              , "code-snippets");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "1"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55307758%2fusing-environment-variable-in-jupyter-notebook-config-py%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              It isn't clear that you are using environment variables properly. I glanced at the docs and it looks like %env JUPYTER_NOTEBOOKS is the right way to do it. I checked this on my local system and it works (for a different env variable). Give that a try - good luck! :-) . Below are the docs.



              https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-env






              share|improve this answer



























                0














                It isn't clear that you are using environment variables properly. I glanced at the docs and it looks like %env JUPYTER_NOTEBOOKS is the right way to do it. I checked this on my local system and it works (for a different env variable). Give that a try - good luck! :-) . Below are the docs.



                https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-env






                share|improve this answer

























                  0












                  0








                  0







                  It isn't clear that you are using environment variables properly. I glanced at the docs and it looks like %env JUPYTER_NOTEBOOKS is the right way to do it. I checked this on my local system and it works (for a different env variable). Give that a try - good luck! :-) . Below are the docs.



                  https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-env






                  share|improve this answer













                  It isn't clear that you are using environment variables properly. I glanced at the docs and it looks like %env JUPYTER_NOTEBOOKS is the right way to do it. I checked this on my local system and it works (for a different env variable). Give that a try - good luck! :-) . Below are the docs.



                  https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-env







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 23 at 11:01









                  jimfjimf

                  1,1621017




                  1,1621017























                      0














                      Thanks jimf your link helped. I was able to get things working because I was NOT using environment variables correctly. Instead of modifying the .py file I added the parameter to my command of starting jupyter notebook like this:



                      --NotebookApp.notebook_dir=$JUPYTER_NOTEBOOKS


                      I was then able to change the variable value and change where jupyter was looking for notebooks.






                      share|improve this answer



























                        0














                        Thanks jimf your link helped. I was able to get things working because I was NOT using environment variables correctly. Instead of modifying the .py file I added the parameter to my command of starting jupyter notebook like this:



                        --NotebookApp.notebook_dir=$JUPYTER_NOTEBOOKS


                        I was then able to change the variable value and change where jupyter was looking for notebooks.






                        share|improve this answer

























                          0












                          0








                          0







                          Thanks jimf your link helped. I was able to get things working because I was NOT using environment variables correctly. Instead of modifying the .py file I added the parameter to my command of starting jupyter notebook like this:



                          --NotebookApp.notebook_dir=$JUPYTER_NOTEBOOKS


                          I was then able to change the variable value and change where jupyter was looking for notebooks.






                          share|improve this answer













                          Thanks jimf your link helped. I was able to get things working because I was NOT using environment variables correctly. Instead of modifying the .py file I added the parameter to my command of starting jupyter notebook like this:



                          --NotebookApp.notebook_dir=$JUPYTER_NOTEBOOKS


                          I was then able to change the variable value and change where jupyter was looking for notebooks.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Mar 25 at 18:54









                          Alex BrownAlex Brown

                          61




                          61



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55307758%2fusing-environment-variable-in-jupyter-notebook-config-py%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                              용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

                              155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해