Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All NotebooksTestCase tests fail with CalledProcessError #275

Closed
jneuff opened this issue Jul 29, 2017 · 6 comments
Closed

All NotebooksTestCase tests fail with CalledProcessError #275

jneuff opened this issue Jul 29, 2017 · 6 comments

Comments

@jneuff
Copy link
Collaborator

jneuff commented Jul 29, 2017

Relevant output:

CalledProcessError: Command '['jupyter', 'nbconvert', '--to', 'notebook', '--execute', '--ExecutePreprocessor.timeout=600', '--ExecutePreprocessor.kernel_name=python2', '--output', '/tmp/tmpu50Tiu.ipynb', 'notebooks/human_activity_recognition_multi_class_example.ipynb']' returned non-zero exit status 1

/usr/lib64/python2.7/subprocess.py:186: CalledProcessError
----------------------------------------- Captured stderr call ------------------------------------------
[NbConvertApp] Converting notebook notebooks/human_activity_recognition_multi_class_example.ipynb to notebook
[NbConvertApp] Executing notebook with kernel: python2
[NbConvertApp] WARNING | Native kernel (python2) is not available

and

File "/home/user/.venvs/tsf2/lib/python2.7/site-packages/jupyter_client/kernelspec.py", line 203, in get_kernel_spec
    raise NoSuchKernel(kernel_name)
jupyter_client.kernelspec.NoSuchKernel: No such kernel named python2

I have the same problem with running the tests with Python 3.
The relevant code of the tests seems to be:

        if six.PY2:
            args += ["--ExecutePreprocessor.kernel_name=python2"]
        elif six.PY3:
            args += ["--ExecutePreprocessor.kernel_name=python3"]

Apparently these settings don't work on my machine (Fedora 26).

@MaxBenChrist
Copy link
Collaborator

Is ipython installed?

I have seen that error when I have only installed jupyter

@nikhase
Copy link
Contributor

nikhase commented Jul 29, 2017

I've had a similar issue. Notebook tests failed on my local machine. The main line of interest in my case was jupyter_client.kernelspec.NoSuchKernel: No such kernel named py27tsfresh.

I am working with Conda and it's environments; the same issue was discussed here. I adapted the solution, and it worked!

In my case, the system's python installation python2 and python3 somehow "masked" my properly configured environment with tsfresh. I did

$ jupyter kernelspec list
Available kernels:
  python2    /home/niklas/.local/share/jupyter/kernels/python2
  python3    /home/niklas/.local/share/jupyter/kernels/python3

These are links to the system's python installations (without tsfresh and dependencies installed), which were apparently called by nbconvert in test_notebooks.py. You might see other kernels as well if you configured to use R, Julia or whatever language in your notebooks. I think, these are the ones visible in the Dropdown-Menu you can choose your kernels from when you open a notebook. However, after

$ jupyter kernelspec remove python2
$ jupyter kernelspec remove python3

I ran the test python setup.py test, and it worked! Now it looks like

$ jupyter kernelspec list
Available kernels:
  python2    /home/niklas/anaconda3/envs/py27tsfresh/lib/python2.7/site-packages/ipykernel/resources

I don't know if it's the same in virtualenv. Maybe you can list your kernels and see if it is somewhere in /home/user/.venvs/tsf2/lib/python2.7/site-packages/....

Use it on your own risk. Please let me now what the issue was.

This solves my post / experience I reported in a former issue as well.

@nikhase
Copy link
Contributor

nikhase commented Jul 29, 2017

@MaxBenChrist do you run tests locally? Do they pass? What is your setup? virtualenv, system python or conda? Thx for info.

@MaxBenChrist
Copy link
Collaborator

@nikhaas virtualenv, Mac OS or Ubuntu 16.04, no problems so far.

@jneuff
Copy link
Collaborator Author

jneuff commented Jul 31, 2017

Thanks for the hints @nikhaas and @MaxBenChrist. However, the strange thing is, that running the tests at a later time actually worked out. I do not have the time to investigate this, but we should keep in mind, that this can be a source of errors.

@MaxBenChrist
Copy link
Collaborator

As this error did not show up again and we excluded notebook tests from the test suite I close this now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants