question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CalledProcessError in Jupyter Notebook/Lab

See original GitHub issue

Summary of your issue

Usage of tabula-py inside ipython on a shell works. Also running java -jar /homeloc/scratch/mimischi/.conda/envs/mdtraj/lib/python3.6/site-packages/tabula/tabula-1.0.1-jar-with-dependencies.jar --pages 1 --guess page_14.pdf works.

I does not work inside of Jupyter Notebook and JupyterLab, throwing the CalledProcessError.

The package and tabula-java seem to work in general, but it does not work with notebooks.

Environment

Write and check your environment. Please paste outputs of specific commands if required.

  • Paste the output of python --version command on your terminal:
$ python --version
Python 3.6.5 :: Anaconda, Inc.
  • Paste the output of java -version command on your terminal:
$ java -version
openjdk version "1.8.0_161"
OpenJDK Runtime Environment (build 1.8.0_161-b14)
OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)
  • Does java -h command work well?; Ensure your java command is included in PATH
  • Write your OS and it’s version: Scientific Linux 7
  • (Optional, but really helpful) Your PDF URL: It’s a non-open scientific paper. I probably can’t share it.

Some more version information:

jupyter==1.0.0
jupyter-client==5.2.3
jupyter-console==5.2.0
jupyter-contrib-core==0.3.3
jupyter-contrib-nbextensions==0.5.0
jupyter-core==4.4.0
jupyter-highlight-selected-word==0.2.0
jupyter-latex-envs==1.4.4
jupyter-nbextensions-configurator==0.4.0
jupyterlab==0.32.0
jupyterlab-launcher==0.10.5
notebook==5.4.1

What did you do when you faced the problem?

Example code:

import tabula
tabula.read_pdf('page_14.pdf', java_options=['-Xmx2048g'])
tabula.convert_into('page_14.pdf', output_path='test.csv')

Output:

---------------------------------------------------------------------------
CalledProcessError                        Traceback (most recent call last)
<ipython-input-29-9b29b5139e99> in <module>()
----> 1 x = tabula.read_pdf('page_14.pdf', java_options=['-Xmx2048g'], encoding='utf-8')

/homeloc/scratch/mimischi/.conda/envs/mdtraj/lib/python3.6/site-packages/tabula/wrapper.py in read_pdf(input_path, output_format, encoding, java_options, pandas_options, multiple_tables, **kwargs)
     73 
     74     try:
---> 75         output = subprocess.check_output(args)
     76     finally:
     77         if is_url:

/homeloc/scratch/mimischi/.conda/envs/mdtraj/lib/python3.6/subprocess.py in check_output(timeout, *popenargs, **kwargs)
    334 
    335     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
--> 336                **kwargs).stdout
    337 
    338 

/homeloc/scratch/mimischi/.conda/envs/mdtraj/lib/python3.6/subprocess.py in run(input, timeout, check, *popenargs, **kwargs)
    416         if check and retcode:
    417             raise CalledProcessError(retcode, process.args,
--> 418                                      output=stdout, stderr=stderr)
    419     return CompletedProcess(process.args, retcode, stdout, stderr)
    420 

CalledProcessError: Command '['java', '-Xmx2048g', '-jar', '/homeloc/scratch/mimischi/.conda/envs/mdtraj/lib/python3.6/site-packages/tabula/tabula-1.0.1-jar-with-dependencies.jar', '--pages', '1', '--guess', 'page_14.pdf']' returned non-zero exit status 1.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
chezoucommented, Apr 25, 2018

Added error message #87

Could you install from github as following?

pip install git+https://github.com/chezou/tabula-py
1reaction
chezoucommented, Apr 25, 2018

hmmm, sounds strange. OK. I’ll add to put the error code from Java.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CalledProcessError (#1454) · Issues · graphviz ... - GitLab
In Jupyter notebook the importing of graphviz creating no issue but whenever I am going to display the graph the following error occurs:....
Read more >
CalledProcessError on using bash commands in magic cell
I have used the code below in my Jupiter notebook. ... line, cell) ~/.local/lib/python3.6/site-packages/IPython/core/magic.py in <lambda>(f, ...
Read more >
Using as a command line tool — nbconvert 7.2.7 documentation
This will convert the Jupyter notebook file notebook.ipynb into the output format given by the FORMAT string. Default output format#.
Read more >
Cannot run Notebook from within VS Code "Running cells with ...
Hi, I have a VS Code installation where I open a jupyter notebook I have previously created in jupyter lab. When I opened...
Read more >
OpenMC crashing on Mac (<Signals.SIGILL: 4>) - User Support
The function openmc.plot_inline(PLOT) works only, I think, in a jupyter notebook (or lab) or in QtConsole. Using jupyter lab is extremely ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found