SimonBiggs / scriptedforms

Quickly create live-update GUIs for Python packages using Markdown and simple HTML elements.
Apache License 2.0
508 stars 34 forks source link

No such file or directory: '/Users/xxx/.jupyter/jupyter_notebook_config.json' #95

Closed robmarkcole closed 6 years ago

robmarkcole commented 6 years ago

As per issue https://github.com/SimonBiggs/scriptedforms/issues/59 I am getting the error:

Robins-MacBook-Air:example robincole$ scriptedforms example.md
Traceback (most recent call last):
  File "/anaconda3/bin/scriptedforms", line 11, in <module>
    sys.exit(main())
  File "/anaconda3/lib/python3.6/site-packages/scriptedforms/scriptedforms.py", line 80, in main
    load(args.filepath, args)
  File "/anaconda3/lib/python3.6/site-packages/scriptedforms/scriptedforms.py", line 51, in load
    install_jupyter_server_extension()
  File "/anaconda3/lib/python3.6/site-packages/scriptedforms/_install_jupyter_server_extension.py", line 13, in install_jupyter_server_extension
    with open(config_path, 'r') as file:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/robincole/.jupyter/jupyter_notebook_config.json'
Robins-MacBook-Air:example robincole$ ls
__init__.py detailed.md example.py  simple.md
Robins-MacBook-Air:example robincole$ scriptedforms simple.md
Traceback (most recent call last):
  File "/anaconda3/bin/scriptedforms", line 11, in <module>
    sys.exit(main())
  File "/anaconda3/lib/python3.6/site-packages/scriptedforms/scriptedforms.py", line 80, in main
    load(args.filepath, args)
  File "/anaconda3/lib/python3.6/site-packages/scriptedforms/scriptedforms.py", line 51, in load
    install_jupyter_server_extension()
  File "/anaconda3/lib/python3.6/site-packages/scriptedforms/_install_jupyter_server_extension.py", line 13, in install_jupyter_server_extension
    with open(config_path, 'r') as file:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/robincole/.jupyter/jupyter_notebook_config.json'
SimonBiggs commented 6 years ago

Ahh, bummer. Okay. As a workaround install jupyterlab, then install scriptedforms. I'll need to fix that.

SimonBiggs commented 6 years ago

Instead of focusing on jupyterhub compatibility tonight I'll need to focus on getting Travis CI set up. Having mistakes like this get through isn't really acceptable.

SimonBiggs commented 6 years ago

Alright this is fixed in scriptedforms 0.5.13. Can you run pip install scriptedforms --upgrade

SimonBiggs commented 6 years ago

If this is fixed on your end with 0.5.13 just close down this issue.

robmarkcole commented 6 years ago

Tryin on my windows machine at work:

  Running setup.py install for scriptedforms ... error
    Complete output from command C:\ProgramData\Anaconda3\python.exe -u -c "impo
rt setuptools, tokenize;__file__='C:\\Users\\sca1el\\AppData\\Local\\Temp\\pip-b
uild-qlk85cgr\\scriptedforms\\setup.py';f=getattr(tokenize, 'open', open)(__file
__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, '
exec'))" install --record C:\Users\sca1el\AppData\Local\Temp\pip-6t8yhrpk-record
\install-record.txt --single-version-externally-managed --compile:
    running install
    error: [Errno 2] No such file or directory: 'C:\\Users\\sca1el\\.jupyter\\ju
pyter_notebook_config.json'

    ----------------------------------------
Command "C:\ProgramData\Anaconda3\python.exe -u -c "import setuptools, tokenize;
__file__='C:\\Users\\sca1el\\AppData\\Local\\Temp\\pip-build-qlk85cgr\\scriptedf
orms\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replac
e('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --recor
d C:\Users\sca1el\AppData\Local\Temp\pip-6t8yhrpk-record\install-record.txt --si
ngle-version-externally-managed --compile" failed with error code 1 in C:\Users\
sca1el\AppData\Local\Temp\pip-build-qlk85cgr\scriptedforms\

I've already updated jupyterhub (0.8.1) and lab (0.31.8)

SimonBiggs commented 6 years ago

Can you run pip install scriptedforms --upgrade

SimonBiggs commented 6 years ago

Actually do this:

pip uninstall scriptedforms
pip install scriptedforms --no-cache
SimonBiggs commented 6 years ago

So, I just removed the trouble code. Now if you want scriptedforms to work as a notebook server extension (which is what is needed for jupyterhub) you'll have to do the following:

pip uninstall scriptedforms
pip install scriptedforms --no-cache
jupyter serverextension enable --py scriptedforms
robmarkcole commented 6 years ago

OK scriptedforms installed which is good. I then get:

(C:\ProgramData\Anaconda3) C:\ProgramData\Anaconda3\etc\conda\activate.d>jupyter
 serverextension enable --py scriptedforms
Traceback (most recent call last):
  File "c:\programdata\anaconda3\lib\runpy.py", line 193, in _run_module_as_main

    "__main__", mod_spec)
  File "c:\programdata\anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\ProgramData\Anaconda3\Scripts\jupyter-serverextension.EXE\__main__.py
", line 9, in <module>
  File "c:\programdata\anaconda3\lib\site-packages\jupyter_core\application.py",
 line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "c:\programdata\anaconda3\lib\site-packages\traitlets\config\application.
py", line 658, in launch_instance
    app.start()
  File "c:\programdata\anaconda3\lib\site-packages\notebook\serverextensions.py"
, line 293, in start
    super(ServerExtensionApp, self).start()
  File "c:\programdata\anaconda3\lib\site-packages\jupyter_core\application.py",
 line 255, in start
    self.subapp.start()
  File "c:\programdata\anaconda3\lib\site-packages\notebook\serverextensions.py"
, line 210, in start
    self.toggle_server_extension_python(arg)
  File "c:\programdata\anaconda3\lib\site-packages\notebook\serverextensions.py"
, line 199, in toggle_server_extension_python
    m, server_exts = _get_server_extension_metadata(package)
  File "c:\programdata\anaconda3\lib\site-packages\notebook\serverextensions.py"
, line 329, in _get_server_extension_metadata
    raise KeyError(u'The Python module {} does not include any valid server exte
nsions'.format(module))
KeyError: 'The Python module scriptedforms does not include any valid server ext
ensions'
SimonBiggs commented 6 years ago

Thanks rob, sorry about that. I really messed up this notebook server extension thing. Okay, try scriptedforms 0.5.15

SimonBiggs commented 6 years ago

So:

pip uninstall scriptedforms
pip install scriptedforms --no-cache
jupyter serverextension enable --py scriptedforms
SimonBiggs commented 6 years ago

@robmarkcole any success?

robmarkcole commented 6 years ago

I need to figure out how to run jupyterhub on my work PC first. jupyterhub is not on the PATH, I have the same problem with sourceand venv

SimonBiggs commented 6 years ago

I don't think it's worth trying to install jupyterhub on a windows machine...

SimonBiggs commented 6 years ago

Alright, Travis CI is set up :). I think I'm going to call it a night. I'll dig down into jupyterhub for you tomorrow night hopefully.

robmarkcole commented 6 years ago

OK getting this error on my Mac. Not that the original issue is fixed in 5.15 so we can close and have jupyterhub as separate issue

SimonBiggs commented 6 years ago

kk