Code Monkey home page Code Monkey logo

jupyter_core's Introduction

Jupyter Core

Build Status Documentation Status

Core common functionality of Jupyter projects.

This package contains base application classes and configuration inherited by other projects. It doesn't do much on its own.

Development Setup

The Jupyter Contributor Guides provide extensive information on contributing code or documentation to Jupyter projects. The limited instructions below for setting up a development environment are for your convenience.

Coding

You'll need Python and pip on the search path. Clone the Jupyter Core git repository to your computer, for example in /my/projects/jupyter_core. Now create an editable install and download the dependencies of code and test suite by executing:

cd /my/projects/jupyter_core/
pip install -e ".[test]"
py.test

The last command runs the test suite to verify the setup. During development, you can pass filenames to py.test, and it will execute only those tests.

Code Styling

jupyter_core has adopted automatic code formatting so you shouldn't need to worry too much about your code style. As long as your code is valid, the pre-commit hook should take care of how it should look. pre-commit and its associated hooks will automatically be installed when you run pip install -e ".[test]"

To install pre-commit manually, run the following:

    pip install pre-commit
    pre-commit install

You can invoke the pre-commit hook by hand at any time with:

    pre-commit run

which should run any autoformatting on your code and tell you about any errors it couldn't fix automatically. You may also install black integration into your text editor to format code automatically.

If you have already committed files before setting up the pre-commit hook with pre-commit install, you can fix everything up using pre-commit run --all-files. You need to make the fixing commit yourself after that.

Documentation

The documentation of Jupyter Core is generated from the files in docs/ using Sphinx. Instructions for setting up Sphinx with a selection of optional modules are in the Documentation Guide. You'll also need the make command. For a minimal Sphinx installation to process the Jupyter Core docs, execute:

pip install sphinx

The following commands build the documentation in HTML format and check for broken links:

cd /my/projects/jupyter_core/docs/
make html linkcheck

Point your browser to the following URL to access the generated documentation:

file:///my/projects/jupyter_core/docs/_build/html/index.html

About the Jupyter Development Team

The Jupyter Development Team is the set of all contributors to the Jupyter project. This includes all of the Jupyter subprojects. A full list with details is kept in the documentation directory, in the file about/credits.txt.

The core team that coordinates development on GitHub can be found here: https://github.com/ipython/.

Our Copyright Policy

Jupyter uses a shared copyright model. Each contributor maintains copyright over their contributions to Jupyter. It is important to note that these contributions are typically only changes to the repositories. Thus, the Jupyter source code in its entirety is not the copyright of any single person or institution. Instead, it is the collective copyright of the entire Jupyter Development Team. If individual contributors want to maintain a record of what changes/contributions they have specific copyright on, they should indicate their copyright in the commit message of the change, when they commit the change to one of the Jupyter repositories.

With this in mind, the following banner should be used in any source code file to indicate the copyright and license terms:

# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

jupyter_core's People

Contributors

andram avatar blink1073 avatar bollwyvl avatar carreau avatar cgohlke avatar coldfix avatar dependabot[bot] avatar florianbussmann avatar hroncok avatar ian-r-rose avatar ivanov avatar jasongrout avatar kevin-bates avatar matthew-brett avatar minrk avatar mseal avatar mstimberg avatar pfmoore avatar pre-commit-ci[bot] avatar rgbkrk avatar rmanly avatar rolweber avatar scolby33 avatar smartass101 avatar takluyver avatar tlinhart avatar vidartf avatar wibbletheduck avatar xmnlab avatar zooba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jupyter_core's Issues

ImportError: dateutil 2.5.0 is the minimum required version

I installed pandas_datareader and started encountering this error when I try to import pandas in Python3.
It works fine for python2 version in Jupyter.
I checked the import statement directly in terminal, and all looks fine. Makes me think its something to do with the version Jupyter is picking up with Python3.
I double checked the dateutil and I do have the 2.7.3 version on my system.
Can you please suggest how to resolve the issue!?

Details:
ImportError Traceback (most recent call last)
in ()
----> 1 import pandas as pd

~/.local/lib/python3.5/site-packages/pandas/init.py in ()
21
22 # numpy compat
---> 23 from pandas.compat.numpy import *
24
25 try:

~/.local/lib/python3.5/site-packages/pandas/compat/init.py in ()
420
421 if LooseVersion(dateutil.version) < LooseVersion('2.5'):
--> 422 raise ImportError('dateutil 2.5.0 is the minimum required version')
423 from dateutil import parser as _date_parser
424 parse_date = _date_parser.parse

ImportError: dateutil 2.5.0 is the minimum required version

Inconsistent Jupyter data directories in documentation

I have noticed some surprising behavior while trying to modify my Jupyter Data directory.

From #46, I understood that data files, runtime files and configuration files should be in three different directories, and that this can be observed using jupyter --paths

The documentation indicates that I should set the variable JUPYTER PATH.

Indeed, I observe the expected behavior:

 $ jupyter --paths
config:[...]
data:
    /home/varal7/.local/share/jupyter
    /scratch/varal7/miniconda3/share/jupyter
    /usr/local/share/jupyter
    /usr/share/jupyter
$ JUPYTER_PATH=/scratch/varal7/local/share/jupyter jupyter --paths
config:[...]
data:
    /scratch/quach/local/share/jupyter
    /home/varal7/.local/share/jupyter
    /scratch/varal7/miniconda3/share/jupyter
    /usr/local/share/jupyter
    /usr/share/jupyter

However, when running a notebook, the files are still saved in /home/varal7/.local/share/jupyter.

Moreover,

$ JUPYTER_PATH=/scratch/varal7/local/share/jupyter jupyter --data-dir
/home/varal7/.local/share/jupyter

Finally, I have come to understand that the correct variable to set is actually JUPYTER_DATA_DIR as I could see in:

$ JUPYTER_DATA_DIR=/scratch/quach/local/share/jupyter jupyter --data-dir
/scratch/quach/local/share/jupyter

This is consistent with documentation I later found here: https://jupyter-core.readthedocs.io/en/latest/paths.html

What's the path for global nbextensions? Get confused about paths.

@takluyver @minrk

As far as I know, jupyter notebook find extensions from jupyter_data_dir(), which points to a user specific dir (like /home/.local/share/jupyter).

My questions is that: in some scenarios, for example, using JupyterHub (https://github.com/jupyter/jupyterhub/issues/305), users want a global path to install shared nbextensions for all users (I guess Python Lib/site-packages is not a good place to store extension data). But what's its officially recommended path (jupyter_data_dir() points to a user specific dir) ?

Besides, it seems confusing of current paths design: jupyter_data_dir(), jupyter_config_dir(), jupyter_config_path(), jupyter_path(). Can anyone fill below table to clarify where each kind of data are officially suggested to be stored?

user specific global (all users)
kernel profile (for Py2, Py3, R, Scala ...) (May be not needed)
extensions (server-side, front-side, templates)
runtime kernel session information (May be not needed)

BTW, I think it would be a nicer design if extensions/kernel profiles from both user-specific and global dirs to be loaded when a notebook server starts for a user.

jupyter nbextension enable --sys-prefix tries to write in $HOME/.jupyter

When executing the command

jupyter nbextension enable --sys-prefix --py widgetsnbextension

I would expect this to only touch system files in sys.prefix. However, this actually tries to create the directory $HOME/.jupyter.

Traceback (most recent call last) when executing the above command as locked-down user with limited access to $HOME:

  File "/home/worker/sage-patchbot/local/bin/jupyter-nbextension", line 6, in <module>
    main()
  File "/home/worker/sage-patchbot/local/lib/python2.7/site-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/home/worker/sage-patchbot/local/lib/python2.7/site-packages/traitlets/config/application.py", line 595, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-6>", line 2, in initialize
  File "/home/worker/sage-patchbot/local/lib/python2.7/site-packages/traitlets/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/worker/sage-patchbot/local/lib/python2.7/site-packages/jupyter_core/application.py", line 239, in initialize
    self.parse_command_line(argv)
  File "<decorator-gen-4>", line 2, in parse_command_line
  File "/home/worker/sage-patchbot/local/lib/python2.7/site-packages/traitlets/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/worker/sage-patchbot/local/lib/python2.7/site-packages/traitlets/config/application.py", line 488, in parse_command_line
    return self.initialize_subcommand(subc, subargv)
  File "<decorator-gen-3>", line 2, in initialize_subcommand
  File "/home/worker/sage-patchbot/local/lib/python2.7/site-packages/traitlets/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/worker/sage-patchbot/local/lib/python2.7/site-packages/traitlets/config/application.py", line 426, in initialize_subcommand
    self.subapp.initialize(argv)
  File "<decorator-gen-6>", line 2, in initialize
  File "/home/worker/sage-patchbot/local/lib/python2.7/site-packages/traitlets/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/worker/sage-patchbot/local/lib/python2.7/site-packages/jupyter_core/application.py", line 243, in initialize
    self.migrate_config()
  File "/home/worker/sage-patchbot/local/lib/python2.7/site-packages/jupyter_core/application.py", line 169, in migrate_config
    migrate()
  File "/home/worker/sage-patchbot/local/lib/python2.7/site-packages/jupyter_core/migrate.py", line 240, in migrate
    ensure_dir_exists(env['jupyter_config'])
  File "/home/worker/sage-patchbot/local/lib/python2.7/site-packages/ipython_genutils/path.py", line 167, in ensure_dir_exists
    os.makedirs(path, mode=mode)
  File "/home/worker/sage-patchbot/local/lib/python/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/home/worker/.jupyter'

CC @SylvainCorlay

Unable to install jupyter dashboards bundlers

I was trying to install jupyter dashboard bundlers for deploying jupyter dashboards but was unsuccessful as i was not able to install it properly. I was getting the error message as " Cannot uninstall 'jupyter-core'. It is a distutils installed project and thus we can not accurately determine which files belong to it which would lead to only a partial uninstall.

jupyter finds wrong python binary with conda

Hi All,
I am having a problem with jupyter finding the wrong version of python.
But first

  1. is this the right forum for this sort of problem?
  2. I don't see a list of details to include in a report. Have I included useful info?

My set-up is

bash Anaconda3-5.1.0-Linux-x86_64.sh
conda env create --file environment.yml
source activate placer-env
conda install nb_conda

and anaconda is installed in /home/dun280/local/anaconda3/

I have been trying to get this to work with elpy mode in emacs. But now I have realized that the problem is something to do with jupyter's paths. The following code snippet shows the problem. In the virtual env, I can see the right jupyter and python but when I start "jupyter console" it picks up the wrong python.

tamar: echo $PATH
/home/dun280/local/anaconda3/bin:/home/dun280/local/anaconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

tamar: which jupyter
/home/dun280/local/anaconda3/bin/jupyter
tamar: which python
/home/dun280/local/anaconda3/bin/python
tamar: python --version
Python 3.6.4 :: Anaconda, Inc.

tamar: source activate placer-env

(placer-env) tamar:  echo $PATH
/home/dun280/local/anaconda3/envs/placer-env/bin:/home/dun280/local/anaconda3/bin:/home/dun280/local/anaconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

(placer-env) tamar: which jupyter
/home/dun280/local/anaconda3/envs/placer-env/bin/jupyter
(placer-env) tamar: jupyter --version
4.4.0

(placer-env) tamar: which python
/home/dun280/local/anaconda3/envs/placer-env/bin/python
(placer-env) tamar: python --version
Python 3.6.5

(placer-env) tamar: jupyter kernelspec list
Available kernels:
python3    /home/dun280/local/anaconda3/envs/placer-env/share/jupyter/kernels/python3

(placer-env) tamar: jupyter console
Jupyter console 5.2.0
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:10:19) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.

See -- "jupyter console" has found Python 3.6.4, so I can't load all of the modules I have installed in the virtual env.

Bye

Should jupyter_core provide jupyter.py?

It seems like juptyer_core should provide jupyter.py so that python -m jupyter works if any jupyter entrypoint is installed, rather than only when the metapackage has been used to install everything. This would conflict with the current behavior of the jupyter metapackage, which writes the same file, but with pip that doesn't actually matter, since the behavior of the file would be unchanged. I would propose the jupyter mpkg actually install an entirely unused jupyter_mpkg.py.

cc @fperez @takluyver @ellisonbg

no "jupyter kernelspec remove" ?

jupyter kernelspec -h shows install, list, and install-self commands, but not remove or similar command. It would be nice to have this.... telling users to dig through the list --json output to figure out the directory location so that they can delete it manually seems a bit too hard.

jupyter-notebook does not exist in /usr/local/bin after doing a pip install jupyter on MAC

[/usr/local/bin]› ls -l | grep jupyter
-rwxr-xr-x 1 root admin 222 Oct 17 16:02 jupyter
-rwxr-xr-x 1 root admin 222 Oct 17 16:02 jupyter-migrate
-rwxr-xr-x 1 root admin 227 Oct 17 16:02 jupyter-troubleshoot
-rwxr-xr-x 1 root admin 255 Oct 17 16:02 jupyter-trust

Why isnt there any jupyter-notebook?

Hence, when i try to run "pupyter notebook" command, I get an error "Error executing Jupyter command 'notebook': [Errno 2] No such file or directory"

zsh autocompletion file

I have written a small zsh autocompletion file for jupyter, currently at http://pastebin.com/XW0nPWjG .
There seemed to be some interest in such a file for ipython (cf ipython/ipython#8767), but I guess it would make more sense to merge this into jupyter_core?
I haven't made this into a PR because I don't know where to put it in the source tree :-)

Change jupyter -h usage example.

jupyter -h yields

usage: jupyter [-h] subcommand

Jupyter: Interactive Computing

positional arguments:
  subcommand  The subcommand to launch

optional arguments:
  -h, --help  show this help message and exit

Available subcommands: kernelspec nbconvert trust install notebook qtconsole
console

which is deceptive, because jupyter -h subcommand just yields the same message. To get the help for a subcommand to display, one has to run jupyter subcommand -h. The cause of this deceptive output appears to be argparser.

Unclear how to obtain jupyter_client version number

This arose in jupyter/nbconvert#328

I eventually noticed that jupyter-client manages jupyter kernelspec so I thought jupyter kernelspec --version might work, and it returned the value I expected so I think that is one way to do it…is that right?

but we might want to put in some kind of a command for either dumping a lot of the relevant jupyter version numbers all at once (for debugging and error locating purposes), or include a jupyter client --version even if all it exists to do is to provide the version number in a more straightforward fashion.


Originally opened as jupyter/jupyter_client#178 by @mpacer, migration requested by @Carreau

Jupyter "Error executing Jupyter command 'notebook': [Errno 'jupyter-notebook' not found] 2"

I have been racking my brain over this issue, but I am having problems opening jupyter from the command prompt. Specifically, it seems that jupyter commands are broken. I am unable to type anything after jupyter with a space, or I receive the error message: "Error executing Jupyter command 'Searches': [Errno 'jupyter-Searches' not found] 2"

Note, that this is not a problem with it not recognizing jupyter from the path. I am able to get the notebook to open by typing jupyter-notebook. However, I am confused as to why all jupyter commands are broken. I have tried reinstalling both jupyter and my entire python installation, but to no avail.

I installed jupyter from the commandline using pip install --force-reinstall --no-cache-dir jupyter.

The only weird error I get when running this is:

ipython 7.0.1 has requirement prompt-toolkit<2.1.0,>=2.0.0, but you'll have prompt-toolkit 1.0.15 which is incompatible.

Dependency on ipython is circular and not necessary

jupyter_core currently depends on ipython in dev mode. However this introduces a circular dependency since ipython depends on jupyter_core for tests (via ipykernel -> jupyter_client -> jupyter_core).
Looking at the code, this dependency actually seems completely unnecessary, the only place where it is used, is here: https://github.com/jupyter/jupyter_core/blob/master/jupyter_core/tests/test_migrate.py#L19-L22
and locate_profile is not used anywhere.

Tests fail from PyPI source

The jupyter_core/tests/dotipython and jupyter_core/tests/dotipython_empty are not included in the PyPI release, causing the tests to fail when run on it.

Lots of jupyter_core warnings when importing another library

Hey.
Since my last conda update I am getting lots of deprecation warnings from jupyter_core when using pyemma (another github project).
I actually cannot determine what causes the warnings to be generated but they are getting spammed so much that the notebook crashes my Firefox.

In [1]: import pyemma                                                                                                                                                                                            
/shared/sdoerr/Software/anaconda3/lib/python3.4/site-packages/jupyter_core/application.py:106: DeprecationWarning: metadata {'config': True} was set from the constructor.  Metadata should be set using the .tag() method, e.g., Int().tag(key1='value1', key2='value2')
  help="""Generate default config file."""
/shared/sdoerr/Software/anaconda3/lib/python3.4/site-packages/jupyter_core/application.py:110: DeprecationWarning: metadata {'config': True} was set from the constructor.  Metadata should be set using the .tag() method, e.g., Int().tag(key1='value1', key2='value2')
  help="Specify a config file to load."
/shared/sdoerr/Software/anaconda3/lib/python3.4/site-packages/jupyter_core/application.py:118: DeprecationWarning: metadata {'config': True} was set from the constructor.  Metadata should be set using the .tag() method, e.g., Int().tag(key1='value1', key2='value2')
  help="""Full path of a config file.""",

and lots more.

Here is the issue I opened on their side.
markovmodel/PyEMMA#683

OSError: [Errno None not found] 2 with 'notebook --generate-config'

niklas@DESKTOP-RQTQ13S MINGW64 ~/Desktop
$ jupyter notepad --generate-config
Traceback (most recent call last):
  File "c:\python35-32\lib\runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python35-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python35-32\Scripts\jupyter.exe\__main__.py", line 9, in <module>
  File "c:\python35-32\lib\site-packages\jupyter_core\command.py", line 186, in main
    _execvp(command, sys.argv[1:])
  File "c:\python35-32\lib\site-packages\jupyter_core\command.py", line 104, in _execvp
    raise OSError('%r not found' % cmd, errno.ENOENT)
OSError: [Errno None not found] 2

Jupyter Version 4.2.0
Windows 10 x64, Git-For-Windows Bash
Python 3.5.2 32-Bit

jupyter taceback

why got i this traceback:

Traceback (most recent call last):
  File "/usr/bin/jupyter-notebook", line 11, in <module> load_entry_point('notebook==5.4.0', 'console_scripts', 'jupyter-notebook')()

   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 587, in load_entry_point return get_distribution(dist).load_entry_point(group, name)

  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2800, in load_entry_point return ep.load()

  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2431, in load return self.resolve()

  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2437, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)

  File "/usr/lib/python3/dist-packages/notebook/notebookapp.py", line 45, in <module> ioloop.install()

  File "/usr/lib/python3/dist-packages/zmq/eventloop/ioloop.py", line 210, in install assert (not ioloop.IOLoop.initialized()) or \

AttributeError: type object 'IOLoop' has no attribute 'initialized'`

i'm on debian testing with a jupyter's instal via repository

regards

jupyter subcommands should be discoverable in help message

ipython --help shows a list of possible subcommands, whereas with the jupyter command it's hard to see what is available:

$ jupyter --help                    
usage: jupyter [-h] subcommand

Jupyter: Interactive Computing

positional arguments:
  subcommand  The subcommand to launch

optional arguments:
  -h, --help  show this help message and exit

I guess it's not trivial to list the subcommands, since they are all separate programs, but it would make it easier to use.

jupyter: 'witness' is not a Jupyter command

I am currently preparing a version bump of jupyter_core for Gentoo Linux. However, during the execution of the tests I got the following error:


=================================================== FAILURES ===================================================
_______________________________________________ test_not_on_path _______________________________________________

tmpdir = local('/var/tmp/portage/dev-python/jupyter_core-4.1.0/temp/pytest-of-brehler/pytest-0/test_not_on_path0')

    def test_not_on_path(tmpdir):
        a = tmpdir.mkdir("a")
        jupyter = a.join('jupyter')
        jupyter.write(
            'from jupyter_core import command; command.main()'
        )
        jupyter.chmod(0o700)
        witness_cmd = 'jupyter-witness'
        if sys.platform == 'win32':
            witness_cmd += '.py'
        witness = a.join(witness_cmd)
        witness.write('#!%s\n%s\n' % (sys.executable, 'print("WITNESS ME")'))
        witness.chmod(0o700)
>       out = check_output([sys.executable, str(jupyter), 'witness'], env={'PATH': ''})

jupyter_core/tests/test_command.py:116: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

popenargs = (['/usr/bin/python2.7', '/var/tmp/portage/dev-python/jupyter_core-4.1.0/temp/pytest-of-brehler/pytest-0/test_not_on_path0/a/jupyter', 'witness'],)
kwargs = {'env': {'PATH': ''}}, process = <subprocess.Popen object at 0x7fe5f1ebddd0>, output = ''
unused_err = None, retcode = 1
cmd = ['/usr/bin/python2.7', '/var/tmp/portage/dev-python/jupyter_core-4.1.0/temp/pytest-of-brehler/pytest-0/test_not_on_path0/a/jupyter', 'witness']

[..]

/usr/lib64/python2.7/subprocess.py:573: CalledProcessError
--------------------------------------------- Captured stderr call ---------------------------------------------
jupyter: 'witness' is not a Jupyter command
===================================== 1 failed, 38 passed in 0.53 seconds ======================================

Greping through the source code of the jupyter repositories, the only line where the keywork witness occurs is in the test code. Hopefully you can give me a hint what's going wrong on my machine or which package should provide jupyter-witness.

Tests failing

I'm getting the following test failures:

+ py.test-2.7 -v jupyter_core/tests/
============================= test session starts ==============================
platform linux2 -- Python 2.7.10 -- py-1.4.29 -- pytest-2.6.4 -- /usr/bin/python
collecting ... collected 38 items

jupyter_core/tests/test_application.py::test_basic PASSED
jupyter_core/tests/test_application.py::test_default_traits PASSED
jupyter_core/tests/test_application.py::test_custom_config PASSED
jupyter_core/tests/test_application.py::test_cli_override PASSED
jupyter_core/tests/test_application.py::test_generate_config PASSED
jupyter_core/tests/test_application.py::test_load_config FAILED
jupyter_core/tests/test_command.py::test_config_dir FAILED
jupyter_core/tests/test_command.py::test_data_dir FAILED
jupyter_core/tests/test_command.py::test_runtime_dir FAILED
jupyter_core/tests/test_command.py::test_paths FAILED
jupyter_core/tests/test_command.py::test_paths_json FAILED
jupyter_core/tests/test_command.py::test_subcommand_not_given FAILED
jupyter_core/tests/test_command.py::test_help FAILED
jupyter_core/tests/test_command.py::test_subcommand_not_found FAILED
jupyter_core/tests/test_command.py::test_subcommand_list PASSED
jupyter_core/tests/test_migrate.py::test_migrate_file PASSED
jupyter_core/tests/test_migrate.py::test_migrate_dir PASSED
jupyter_core/tests/test_migrate.py::test_migrate_one PASSED
jupyter_core/tests/test_migrate.py::test_migrate_config PASSED
jupyter_core/tests/test_migrate.py::test_migrate_custom_default PASSED
jupyter_core/tests/test_migrate.py::test_migrate_nothing PASSED
jupyter_core/tests/test_migrate.py::test_migrate_default PASSED
jupyter_core/tests/test_migrate.py::test_migrate PASSED
jupyter_core/tests/test_paths.py::test_config_dir_darwin PASSED
jupyter_core/tests/test_paths.py::test_config_dir_windows PASSED
jupyter_core/tests/test_paths.py::test_config_dir_linux PASSED
jupyter_core/tests/test_paths.py::test_data_dir_env PASSED
jupyter_core/tests/test_paths.py::test_data_dir_darwin PASSED
jupyter_core/tests/test_paths.py::test_data_dir_windows PASSED
jupyter_core/tests/test_paths.py::test_data_dir_linux PASSED
jupyter_core/tests/test_paths.py::test_runtime_dir_env PASSED
jupyter_core/tests/test_paths.py::test_runtime_dir_darwin PASSED
jupyter_core/tests/test_paths.py::test_runtime_dir_windows PASSED
jupyter_core/tests/test_paths.py::test_runtime_dir_linux PASSED
jupyter_core/tests/test_paths.py::test_jupyter_path PASSED
jupyter_core/tests/test_paths.py::test_jupyter_path_env PASSED
jupyter_core/tests/test_paths.py::test_jupyter_path_sys_prefix PASSED
jupyter_core/tests/test_paths.py::test_jupyter_path_subdir PASSED

=================================== FAILURES ===================================
_______________________________ test_load_config _______________________________

    def test_load_config():
        config_dir = mkdtemp()
        wd = mkdtemp()
        with open(pjoin(config_dir, 'dummy_app_config.py'), 'w') as f:
            f.write('c.DummyApp.m = 1\n')
            f.write('c.DummyApp.n = 1')
        with patch.object(py3compat, 'getcwd', lambda : wd):
            app = DummyApp(config_dir=config_dir)
>           app.initialize()

jupyter_core/tests/test_application.py:80: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
<string>:2: in initialize
    ???
/usr/lib/python2.7/site-packages/traitlets/config/application.py:75: in catch_config_error
    return method(app, *args, **kwargs)
jupyter_core/application.py:233: in initialize
    self.parse_command_line(argv)
<string>:2: in parse_command_line
    ???
/usr/lib/python2.7/site-packages/traitlets/config/application.py:81: in catch_config_error
    app.exit(1)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <jupyter_core.tests.test_application.DummyApp object at 0x7f2fa7997410>
exit_status = 1

    def exit(self, exit_status=0):
        self.log.debug("Exiting application: %s" % self.name)
>       sys.exit(exit_status)
E       SystemExit: 1

/usr/lib/python2.7/site-packages/traitlets/config/application.py:582: SystemExit
----------------------------- Captured stdout call -----------------------------
A Jupyter Application

Options
-------

Arguments that take values are actually convenience aliases to full
Configurables, whose aliases are listed on the help line. For more information
on full configurables, see '--help-all'.

--debug
    set log level to logging.DEBUG (maximize logging output)
-y
    Answer yes to any questions instead of prompting.
--generate-config
    generate default config file
--config=<Unicode> (JupyterApp.config_file)
    Default: u''
    Full path of a config file.
--log-level=<Enum> (Application.log_level)
    Default: 30
    Choices: (0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL')
    Set the log level by value or name.

To see all available configurables, use `--help-all`

----------------------------- Captured stderr call -----------------------------
[DummyApp] CRITICAL | Bad config encountered during initialization:
[DummyApp] CRITICAL | Unrecognized flag: '-v'
_______________________________ test_config_dir ________________________________

    def test_config_dir():
>       assert_output('--config-dir', jupyter_config_dir())

jupyter_core/tests/test_command.py:35: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
jupyter_core/tests/test_command.py:31: in assert_output
    assert get_jupyter_output(cmd) == expected
jupyter_core/tests/test_command.py:27: in get_jupyter_output
    return check_output(['jupyter'] + cmd).decode('utf8').strip()
/usr/lib64/python2.7/subprocess.py:566: in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
/usr/lib64/python2.7/subprocess.py:710: in __init__
    errread, errwrite)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

local variable 'custom_css_empty' referenced before assignment at start notebook in Ubuntu14

I installed ipython several monthes ago, so I installed jupyter following the installation, Existing IPython Notebook users upgrading to Jupyter Notebook

I had this error when I started notebook. It looks like #52 ,but actually it not.

$ sudo pip install -U jupyter
...
...
$ jupyter notebook

Traceback (most recent call last):
  File "/usr/local/bin/jupyter-notebook", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py", line 591, in launch_instance
    app.initialize(argv) File "<string>", line 2, in initialize
  File "/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/notebook/notebookapp.py", line 1001, in initialize
    super(NotebookApp, self).initialize(argv) File "<string>", line 2, in initialize
  File "/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/jupyter_core/application.py", line 243, in initialize
    self.migrate_config()
  File "/usr/local/lib/python2.7/dist-packages/jupyter_core/application.py", line 169, in migrate_config
    migrate() 
  File "/usr/local/lib/python2.7/dist-packages/jupyter_core/migrate.py", line 232, in migrate
    if migrate_static_custom(custom_src, custom_dst): 
  File "/usr/local/lib/python2.7/dist-packages/jupyter_core/migrate.py", line 160, in migrate_static_custom
    if custom_css_empty:
UnboundLocalError: local variable 'custom_css_empty' referenced before assignment

Here is my ~/.ipython directory:

$ tree -a ~/.ipython                                                         
/home/neil/.ipython
├── [drwxrwxr-x]  extensions
├── [drwxrwxr-x]  nbextensions
├── [drwxrwxr-x]  profile_default
│   ├── [drwxrwxr-x]  db
│   ├── [-rw-r--r--]  history.sqlite
│   ├── [drwxrwxr-x]  log
│   ├── [drwx------]  pid
│   ├── [drwx------]  security
│   ├── [drwxrwxr-x]  startup
│   │   └── [-rw-r--r--]  README
│   └── [drwxrwxr-x]  static
│       └── [drwxrwxr-x]  custom
└── [-rw-r--r--]  README

10 directories, 3 files

This error can be reproduced in my computer using the scripts ./scripts/jupyter-migrate

$ ./scripts/jupyter-migrate 

Traceback (most recent call last):
  File "./scripts/jupyter-migrate", line 7, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py", line 592, in launch_instance
    app.start()
  File "/usr/local/lib/python2.7/dist-packages/jupyter_core/migrate.py", line 263, in start
    if not migrate():
  File "/usr/local/lib/python2.7/dist-packages/jupyter_core/migrate.py", line 232, in migrate
    if migrate_static_custom(custom_src, custom_dst):
  File "/usr/local/lib/python2.7/dist-packages/jupyter_core/migrate.py", line 160, in migrate_static_custom
    if custom_css_empty:
UnboundLocalError: local variable 'custom_css_empty' referenced before assignment

My system information:

$ python -c "import IPython; print(IPython.sys_info())"
{'commit_hash': u'f534027',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': '/usr/local/lib/python2.7/dist-packages/IPython',
 'ipython_version': '4.0.0',
 'os_name': 'posix',
 'platform': 'Linux-3.13.0-62-generic-x86_64-with-Ubuntu-14.04-trusty',
 'sys_executable': '/usr/bin/python',
 'sys_platform': 'linux2',
 'sys_version': '2.7.6 (default, Jun 22 2015, 17:58:13) \n[GCC 4.8.2]'}

Load_config inconsitency.

Roughly, Application.load_config deal with both self.config_file(s) that are full path,self.paths and self.config_file_name, that are just base name. A mix of name=full_path, name=base_name etc... are passed to traitlets Application.load_config

bash: /usr/share/applications/anaconda3/bin/jupyter: /root/anaconda3/bin/python: bad interpreter: No such file or directory

  • My operating system is Ubuntu 16.04
  • I have installed anaconda in my machine
  • Other than anaconda I have Python2.7 and Python3.5 pre-installed in my machine with Ubuntu 16.04
  • I have stored the path to my anaconda3/bin folder in $PATH which is defined in my .bashrc file
  • when I run jupyter notebook I get the following error :
    bash: /usr/share/applications/anaconda3/bin/jupyter: /root/anaconda3/bin/python: bad interpreter: No such file or directory
  • When I installed jupyter notebook with my pre-installed Python3.5 then ipython notebook works
  • But I want it to work it with ancaonda python

Downloading as .py fails

Not sure if this is the right location, but I upgraded ipython notebook to version 3.0 using anaconda and
therefore using jupiter.

 ipython notebook --version
3.0.0

I am on a mac running OS X version 10.10.2

When I try using the toolbar to download the notebook as a python file, or html or rst or pdf, I get a page
saying

500: Internal Server Error 
the error was 
Could not import nbconvert: No module named mistune

Thanks for help in advance

add solekernel subcommand to jupyter command.

I can't find a way to just start a kernel without using notebook or console/qtconsole.

The only way to start one and leave it there running is or to start notebook and go click,click,click, or to start qtconsole and exit with keep_kernel.

There is a kernel manager?

I just want to find a way to start several kernels and keep them running in the background without the browser. I know that I can manage the kernels in the notebook server but can't find a way to run a new kernel in bash. am I blind regarding the documentation?

Use jupyter command, It show error: No such file or directory

Hi, All,
I download source code from git repo. I checkout tag 4.1.0, and I install jupyter_core from source code to replace jupyter_core which installed by anaconda. while ,when I finished install, I try use jupyter command, it show error:

: No such file or directory

Install jupyter_core from source code:

[root@linux-59 jupyter_core]# python setup.py install
running install
running build
running build_py
running build_scripts
running install_lib
creating /usr/local/Python/lib/python2.7/site-packages/jupyter_core
copying build/lib/jupyter_core/__init__.py -> /usr/local/Python/lib/python2.7/site-packages/jupyter_core
....
....
byte-compiling /usr/local/Python/lib/python2.7/site-packages/jupyter_core/tests/dotipython/profile_default/ipython_config.py to ipython_config.pyc
byte-compiling /usr/local/Python/lib/python2.7/site-packages/jupyter_core/tests/dotipython/profile_default/ipython_console_config.py to ipython_console_config.pyc
byte-compiling /usr/local/Python/lib/python2.7/site-packages/jupyter_core/tests/dotipython/profile_default/ipython_kernel_config.py to ipython_kernel_config.pyc
byte-compiling /usr/local/Python/lib/python2.7/site-packages/jupyter_core/tests/dotipython/profile_default/ipython_notebook_config.py to ipython_notebook_config.pyc
byte-compiling /usr/local/Python/lib/python2.7/site-packages/jupyter_core/tests/test_paths.py to test_paths.pyc
running install_scripts
copying build/scripts-2.7/jupyter-migrate -> /usr/local/Python/bin
copying build/scripts-2.7/jupyter -> /usr/local/Python/bin
changing mode of /usr/local/Python/bin/jupyter-migrate to 755
changing mode of /usr/local/Python/bin/jupyter to 755
running install_egg_info
Writing /usr/local/Python/lib/python2.7/site-packages/jupyter_core-4.1.0-py2.7.egg-info

I use command:

[root@linux-59 jupyter_core]# /usr/local/Python/bin/jupyter
: No such file or directory
[root@linux-59 jupyter_core]# /usr/local/Python/bin/jupyter --h
: No such file or directory

Does some config i miss?

Complete notebook files in ZSH completion

Hi, I’m trying to get jupyter notebook <tab> to show me both subcommands and notebook files as options here.

sadly i don’t seem to get what’s going on. whatever i tried, it throws errors at some point.

can somebody explain how it works? my progress:

  • ${(P)subcmd}} means “expand to the value of the variable named $subcmd”. i.e. if subcmd=notebook, it expands to $notebook, which is previously set to the output of $(jupyter notebook --help-all | grep … | sed …)

    so ${(P)subcmd}} aka $notebook (in one branch) holds the _arguments-formatted options to the notebook subcommand

  • _${subcmd}_cmds aka _notebook_cmds (in one branch) holds _describe output.

below my most recent attempts:

  1. eval-string

    _alternative \
      'notebook:notebook:_files -g "*.ipynb"' \
      "subcommands:subcommands:{_${subcmd}_cmds && echo ${(P)subcmd}}" && ret=0

    at some point it prints the stuff instead of using it… do i have to do this? is there a better way? _alternative … "subcommands:subcommands:{$(_${subcmd}_cmds && echo ${(P)subcmd})}"

  2. function

    _cmds_and_opts() {
        _${subcmd}_cmds
        echo ${(P)subcmd}
    }
    _alternative \
      'notebook:notebook:_files -g "*.ipynb"' \
      "subcommands:subcommands:_cmds_and_opts" && ret=0

    huh? can’t i redefine functions? or what’s wrong

Test failure on OpenBSD

I'm testing version 4.0.6.

Looks like a directory has not been created:

> /usr/local/bin/py.test /usr/local/lib/python2.7/site-packages/jupyter_core/tests/
============================= test session starts ==============================
platform openbsd5 -- Python 2.7.10 -- py-1.4.23 -- pytest-2.6.1
collected 38 items

../../../../local/lib/python2.7/site-packages/jupyter_core/tests/test_application.py ......
../../../../local/lib/python2.7/site-packages/jupyter_core/tests/test_command.py .........
../../../../local/lib/python2.7/site-packages/jupyter_core/tests/test_migrate.py .......F
../../../../local/lib/python2.7/site-packages/jupyter_core/tests/test_paths.py ...............

=================================== FAILURES ===================================
_________________________________ test_migrate _________________________________

env = {'IPYTHONDIR': '/tmp/tmpon3PGZ/ipython', 'JUPYTER_CONFIG_DIR': '/tmp/tmpon3PGZ/jupyter', 'JUPYTER_DATA_DIR': '/tmp/tmpon3PGZ/jupyter_data', 'JUPYTER_PATH': '', ...}

    def test_migrate(env):
        shutil.copytree(dotipython, env['IPYTHONDIR'])
>       migrate()

/usr/local/lib/python2.7/site-packages/jupyter_core/tests/test_migrate.py:215: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python2.7/site-packages/jupyter_core/migrate.py:227: in migrate
    if migrate_config(name, env):
/usr/local/lib/python2.7/site-packages/jupyter_core/migrate.py:202: in migrate_config
    if migrate_file(src, dst, substitutions=config_substitutions):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

src = '/tmp/tmpon3PGZ/ipython/profile_default/ipython_notebook_config.py'
dst = '/tmp/tmpon3PGZ/jupyter/jupyter_notebook_config.py'
substitutions = {<_sre.SRE_Pattern object at 0xb9d38a59030>: 'JupyterQtConsoleApp', <_sre.SRE_Pattern object at 0xb9d9e1d0200>: 'Jupyt...RE_Pattern object at 0xb9db2f3e660>: 'RichJupyterWidget', <_sre.SRE_Pattern object at 0xb9db2f3e768>: 'nbconvert', ...}

    def migrate_file(src, dst, substitutions=None):
        """Migrate a single file from src to dst

        substitutions is an optional dict of {regex: replacement} for performing replacements on the file.
        """
        log = get_logger()
        if os.path.exists(dst):
            # already exists
            log.debug("%s already exists" % dst)
            return False
        log.info("Copying %s -> %s" % (src, dst))
        ensure_dir_exists(os.path.dirname(dst))
        shutil.copy(src, dst)
        if substitutions:
            with open(dst) as f:
                text = f.read()
            for pat, replacement in substitutions.items():
                text = pat.sub(replacement, text)
>           with open(dst, 'w') as f:
                f.write(text)
E               IOError: [Errno 13] Permission denied: '/tmp/tmpon3PGZ/jupyter/jupyter_notebook_config.py'

/usr/local/lib/python2.7/site-packages/jupyter_core/migrate.py:110: IOError
===================== 1 failed, 37 passed in 1.83 seconds ======================
> ls  -al /tmp/tmpon3PGZ/jupyter/
ls: /tmp/tmpon3PGZ/jupyter/: No such file or directory
> ls  -al /tmp/tmpon3PGZ          
ls: /tmp/tmpon3PGZ: No such file or directory

jupyter command ends up installed with each Python version

We tell people to install ipykernel on the 'other' version of Python to make the Python kernel available for that Python. But that depends on jupyter_core, so the jupyter command gets installed again with its shebang pointing to the other version of Python, the one on which they have no Jupyter applications installed.

I'm not sure if this actually has any adverse effects, but it seems like a potential source of confusion, e.g. if jupyter_core is updated on one Python but not the other, or just using jupyter troubleshoot to troubleshoot.

From ipython/ipykernel#40

Bash completion file crashes gnome-terminal

When I drop the examples/jupyter-completion.bash from the master branch in /etc/bash_completion.d/ gnome-terminal crashes when typing jupyter con followed by hitting the tab key.

expected behavior is completion of jupyter console
startup of jupyter console command shows:

Jupyter console 5.1.0

Python 3.5.2 (default, Sep 14 2017, 22:51:06) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.1.0 -- An enhanced Interactive Python. Type '?' for help.

Environment:

python3 -c "import IPython; print(IPython.sys_info())"
{'commit_hash': 'd86648c5d',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': '/home/antonios/.local/lib/python3.5/site-packages/IPython',
 'ipython_version': '6.1.0',
 'os_name': 'posix',
 'platform': 'Linux-4.11.0-kfd-compute-rocm-rel-1.6-180-x86_64-with-Ubuntu-16.04-xenial',
 'sys_executable': '/usr/bin/python3',
 'sys_platform': 'linux',
 'sys_version': '3.5.2 (default, Sep 14 2017, 22:51:06) \n[GCC 5.4.0 20160609]'}

FileNotFoundError with custom.js and custom.css at start notebook in Debian

ErunamoJAZZ opened jupyter/notebook#414 at 2015-09-10 18:15:18 UTC

Hi.

I did usual installation for jupyter in my debian laptop, but starting the netbook i had this error:

$ jupyter notebook
Traceback (most recent call last):
  File "/usr/local/bin/jupyter-notebook", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.4/dist-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/traitlets/config/application.py", line 591, in launch_instance
    app.initialize(argv)
  File "<string>", line 2, in initialize
  File "/usr/local/lib/python3.4/dist-packages/traitlets/config/application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/notebook/notebookapp.py", line 1001, in initialize
    super(NotebookApp, self).initialize(argv)
  File "<string>", line 2, in initialize
  File "/usr/local/lib/python3.4/dist-packages/traitlets/config/application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/jupyter_core/application.py", line 243, in initialize
    self.migrate_config()
  File "/usr/local/lib/python3.4/dist-packages/jupyter_core/application.py", line 169, in migrate_config
    migrate()
  File "/usr/local/lib/python3.4/dist-packages/jupyter_core/migrate.py", line 230, in migrate
    if migrate_static_custom(custom_src, custom_dst):
  File "/usr/local/lib/python3.4/dist-packages/jupyter_core/migrate.py", line 142, in migrate_static_custom
    with open(custom_js) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/.ipython/profile_default/static/custom/custom.js'

For fix, i did this: $ touch /home/user/.ipython/profile_default/static/custom/custom.js (Remember, touch command create a empty text file). And then, i had another error:

$ jupyter notebook
Traceback (most recent call last):
  File "/usr/local/bin/jupyter-notebook", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.4/dist-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/traitlets/config/application.py", line 591, in launch_instance
    app.initialize(argv)
  File "<string>", line 2, in initialize
  File "/usr/local/lib/python3.4/dist-packages/traitlets/config/application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/notebook/notebookapp.py", line 1001, in initialize
    super(NotebookApp, self).initialize(argv)
  File "<string>", line 2, in initialize
  File "/usr/local/lib/python3.4/dist-packages/traitlets/config/application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/jupyter_core/application.py", line 243, in initialize
    self.migrate_config()
  File "/usr/local/lib/python3.4/dist-packages/jupyter_core/application.py", line 169, in migrate_config
    migrate()
  File "/usr/local/lib/python3.4/dist-packages/jupyter_core/migrate.py", line 230, in migrate
    if migrate_static_custom(custom_src, custom_dst):
  File "/usr/local/lib/python3.4/dist-packages/jupyter_core/migrate.py", line 152, in migrate_static_custom
    with open(custom_css) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/.ipython/profile_default/static/custom/custom.css'

And i used touch again for fix this.

Idk if is possible add a catch for create this files automatically when this happens. Thanks :)

FeatureRequest: Please support latex style cross referencing

Hi

For my project, I write both raw tex file directly and also ipython files which I later convert to tex and compile both as chapters for final pdf. Due to information dependency, I sometimes have to refer equation in raw tex file from ipython notebook. If it had been another tex file, I could have used \externaldocument option, but I could not find any equivalent in ipython to do that. I see Mathjax supports \ref but the part referencing should be in the same file. So afaik, I could not find any way to achieve cross referencing in ipython.

Can you please let me know if there is still any way or workaround to do this? If not, can you kindly consider implementing.

Since ipython is wonderful for literate programming, it is becoming more and more friendlier choice for academic journals, so support for such latex functionalities becomes highly desirable. Kindly consider the request.

Autocomplete list is duplicated in jupyter notebook and consoles

This:

Happens in notebook, console and qtconsole.

But it does not happen in ipython terminal - no duplicates there.

Versions (on win10x64):

jupyter              1.0.0     py36_0    conda-forge
jupyter_client       5.2.1     py36_0    conda-forge
jupyter_console      5.2.0     py36_0    conda-forge
jupyter_core         4.4.0     py36_0    conda-forge
                             
ipython              6.2.1     py36_1    conda-forge
ipython_genutils     0.2.0     py36_0    conda-forge

Downgrading jupyter_core (down to 4.0.2) does not help.

Downgrading ipython to 5.5.0 "fixes" the issue.

Linked issue

"Download as" yields HTML files

I have tried downloading my code as .py and .md. In Safari, they both download as HTML files. Not quite sure what's going on here - I have IPython 3.1.0 (with notebook) installed. Might you guys have an idea?

A suggestion about markdown for jupyter

I think that editting markdown file is not a good experience, especially there are many latex equations.
I recommend jupyter gives a preview for mardown file when edit it.
Just like:

jupyter

__pycache__ in the wheel

In the wheel on PyPI there are the following directories:

jupyter_core/tests/__pycache__/
jupyter_core/tests/dotipython/profile_default/__pycache__/
jupyter_core/tests/dotipython_empty/profile_default/__pycache__/

Should they be there?

I noticed this because we only deploy .pyc files so after the pip install I pull the .pyc files out of __pycache__ and into the location of the .py files using this script.

https://bitbucket.org/Siecje/restore_pyc/src/9834a5c2c16acf29b5b330ebd7590585bc20126b/restore_pyc.py?at=default&fileviewer=file-view-default

I noticed that the resulting .pyc had a different magic code. There is likely a bug in the restore_pyc.py script linked above as it should be finding the .pyc file that was created during the pip install.

But I figured I would report that there are __pycache__ directories in the wheel.

Changing the Location of the Jupyter Config Directory

I might be missing something, but I do not know how to modify the location of the Jupyter Config directory.

Before "The Big Split" I had my .ipython $IPYTHONDIR set to a single location accessible from multiple machines, not having to duplicate the location of templates.

Today I spun up a brand new Ubuntu 14.04 box, set the environmental variable described above and installed Jupyter on it, the latest release.

On the first run of jupyter notebook those config files were copied (PASTED BELOW), and from that point Jupyter ignores the files in $IPYTHONDIR from that point forward.

Would love to either be 1) pointed to the appropriate docs to change the location of jupyter --config-dir from it's default location 2) or get some idea of an ETA for this functionality to be available or 3) tell me how to hack it so I can put the config files anywhere I want, which may very well include some option when running jupyter notebook to copy config files again. Seems like that might be the easiest implementation.

Here's an output of the various paths Jupyter users. I'm interested in modifying the location of the first path in the "config" key below.

{  
   "data":[  
      "/home/vagrant/.local/share/jupyter",
      "/usr/local/share/jupyter",
      "/usr/share/jupyter"
   ],
   "runtime":[  
      "/run/user/1000/jupyter"
   ],
   "config":[  
      "/home/vagrant/.jupyter",
      "/usr/etc/jupyter",
      "/usr/local/etc/jupyter",
      "/etc/jupyter"
   ]

----output of first run of JUPYTER NOTEBOOK: copying config files from $IPYTHONDIR...---

vagrant@vagrant-ubuntu-trusty-64:~$ jupyter notebook
[I 18:24:24.761 NotebookApp] Copying /vagrant/.ipython/profile_default/security/notebook_secret -> /home/vagrant/.local/share/jupyter/notebook_secret
[I 18:24:24.768 NotebookApp] Copying /vagrant/.ipython/profile_default/nbconfig -> /home/vagrant/.jupyter/nbconfig
[I 18:24:24.778 NotebookApp] Copying /vagrant/.ipython/nbextensions -> /home/vagrant/.local/share/jupyter/nbextensions
[I 18:24:25.296 NotebookApp] Copying /vagrant/.ipython/profile_default/security/nbsignatures.db -> /home/vagrant/.local/share/jupyter/nbsignatures.db
[I 18:24:25.301 NotebookApp] Copying /vagrant/.ipython/profile_default/security/notebook_cookie_secret -> /home/vagrant/.local/share/jupyter/notebook_cookie_secret
[I 18:24:25.307 NotebookApp] Copying /vagrant/.ipython/profile_default/ipython_notebook_config.py -> /home/vagrant/.jupyter/jupyter_notebook_config.py
[I 18:24:25.313 NotebookApp] Copying /vagrant/.ipython/profile_default/ipython_nbconvert_config.py -> /home/vagrant/.jupyter/jupyter_nbconvert_config.py
[I 18:24:25.323 NotebookApp] Copying /vagrant/.ipython/profile_default/static/custom/custom.css -> /home/vagrant/.jupyter/custom/custom.css

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.