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

ValueError: I/O operation on closed file #176

Open
domenico-somma opened this issue Sep 23, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@domenico-somma
Copy link

commented Sep 23, 2018

Hi Guys,
I am quite new of python, so probably I am doing something wrong. I am trying to generate the doc for a project. pydoc works but pdoc doesn't and I do know why. Here I go in the folder with my .py file and:


lab@domenico-HP-ENVY-Notebook:~/Documents/GitHub/Papillon$ pydoc papillon

lab@domenico-HP-ENVY-Notebook:~/Documents/GitHub/Papillon$ pdoc papillon
Traceback (most recent call last):
  File "/home/lab/anaconda3/bin/pdoc", line 477, in <module>
    module = pdoc.import_module(args.module_name)
  File "/home/lab/anaconda3/lib/python3.6/site-packages/pdoc/__init__.py", line 326, in import_module
    __import__(module_name)
ModuleNotFoundError: No module named 'papillon'

lab@domenico-HP-ENVY-Notebook:~/Documents/GitHub/Papillon$ pdoc papillon.py
Traceback (most recent call last):
  File "/home/lab/anaconda3/bin/pdoc", line 472, in <module>
    module = imp.load_source('__pdoc_file_module__', fp, f)
  File "/home/lab/anaconda3/lib/python3.6/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/lab/Documents/GitHub/Papillon/papillon.py", line 9, in <module>
    import seaborn as sns
  File "/home/lab/anaconda3/lib/python3.6/site-packages/seaborn/__init__.py", line 16, in <module>
    from .widgets import *
  File "/home/lab/anaconda3/lib/python3.6/site-packages/seaborn/widgets.py", line 8, in <module>
    from ipywidgets import interact, FloatSlider, IntSlider
  File "/home/lab/anaconda3/lib/python3.6/site-packages/ipywidgets/__init__.py", line 23, in <module>
    from IPython import get_ipython
  File "/home/lab/anaconda3/lib/python3.6/site-packages/IPython/__init__.py", line 55, in <module>
    from .terminal.embed import embed
  File "/home/lab/anaconda3/lib/python3.6/site-packages/IPython/terminal/embed.py", line 16, in <module>
    from IPython.terminal.interactiveshell import TerminalInteractiveShell
  File "/home/lab/anaconda3/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py", line 82, in <module>
    if not _stream or not hasattr(_stream, 'isatty') or not _stream.isatty():
ValueError: I/O operation on closed file

pydoc papillon works
pdoc papillon can't find the module
pdoc papillon.py read the file but gives me this error

Can you help me? Thanks.

@domenico-somma

This comment has been minimized.

Copy link
Author

commented Sep 24, 2018

I tried the same on another computer (same OS Ubuntu 16.04) and it worked (almost, I got another issue but I found a workaround).
Let me know if you have any idea how to fix the first one.
Thanks.

@kernc

This comment has been minimized.

Copy link
Contributor

commented Sep 24, 2018

Try to update IPython.

pip install --update ipython ipykernel
@domenico-somma

This comment has been minimized.

Copy link
Author

commented Sep 25, 2018

Done, still same issue:

lab@domenico-HP-ENVY-Notebook:~/Documents/GitHub/Papillon$ pip install ipython ipykernel -U
Collecting ipython
  Downloading https://files.pythonhosted.org/packages/f7/62/2fef7db3a7b75e8099c3d9db2630ae5ba0b9eefefd91f7497862393d90e8/ipython-6.5.0-py3-none-any.whl (748kB)
    100% |████████████████████████████████| 757kB 6.8MB/s 
Collecting ipykernel
  Downloading https://files.pythonhosted.org/packages/7a/de/a03a5c1f8b743675add3c98f1eb877c67bb29c5196ee6ce54e9c839d23cc/ipykernel-4.9.0-py3-none-any.whl (110kB)
    100% |████████████████████████████████| 112kB 5.8MB/s 
Requirement already satisfied, skipping upgrade: decorator in /home/lab/anaconda3/lib/python3.6/site-packages (from ipython) (4.1.2)
Requirement already satisfied, skipping upgrade: simplegeneric>0.8 in /home/lab/anaconda3/lib/python3.6/site-packages (from ipython) (0.8.1)
Requirement already satisfied, skipping upgrade: prompt-toolkit<2.0.0,>=1.0.15 in /home/lab/anaconda3/lib/python3.6/site-packages (from ipython) (1.0.15)
Requirement already satisfied, skipping upgrade: jedi>=0.10 in /home/lab/anaconda3/lib/python3.6/site-packages (from ipython) (0.11.1)
Collecting backcall (from ipython)
  Downloading https://files.pythonhosted.org/packages/84/71/c8ca4f5bb1e08401b916c68003acf0a0655df935d74d93bf3f3364b310e0/backcall-0.1.0.tar.gz
Requirement already satisfied, skipping upgrade: setuptools>=18.5 in /home/lab/anaconda3/lib/python3.6/site-packages (from ipython) (40.4.3)
Requirement already satisfied, skipping upgrade: pickleshare in /home/lab/anaconda3/lib/python3.6/site-packages (from ipython) (0.7.4)
Requirement already satisfied, skipping upgrade: traitlets>=4.2 in /home/lab/anaconda3/lib/python3.6/site-packages (from ipython) (4.3.2)
Requirement already satisfied, skipping upgrade: pygments in /home/lab/anaconda3/lib/python3.6/site-packages (from ipython) (2.2.0)
Requirement already satisfied, skipping upgrade: pexpect; sys_platform != "win32" in /home/lab/anaconda3/lib/python3.6/site-packages (from ipython) (4.3.1)
Requirement already satisfied, skipping upgrade: tornado>=4.0 in /home/lab/anaconda3/lib/python3.6/site-packages (from ipykernel) (4.5.3)
Requirement already satisfied, skipping upgrade: jupyter-client in /home/lab/anaconda3/lib/python3.6/site-packages (from ipykernel) (5.2.1)
Requirement already satisfied, skipping upgrade: six>=1.9.0 in /home/lab/anaconda3/lib/python3.6/site-packages (from prompt-toolkit<2.0.0,>=1.0.15->ipython) (1.11.0)
Requirement already satisfied, skipping upgrade: wcwidth in /home/lab/anaconda3/lib/python3.6/site-packages (from prompt-toolkit<2.0.0,>=1.0.15->ipython) (0.1.7)
Requirement already satisfied, skipping upgrade: parso==0.1.* in /home/lab/anaconda3/lib/python3.6/site-packages (from jedi>=0.10->ipython) (0.1.1)
Requirement already satisfied, skipping upgrade: ipython_genutils in /home/lab/anaconda3/lib/python3.6/site-packages (from traitlets>=4.2->ipython) (0.2.0)
Requirement already satisfied, skipping upgrade: jupyter_core in /home/lab/anaconda3/lib/python3.6/site-packages (from jupyter-client->ipykernel) (4.4.0)
Requirement already satisfied, skipping upgrade: pyzmq>=13 in /home/lab/anaconda3/lib/python3.6/site-packages (from jupyter-client->ipykernel) (16.0.3)
Requirement already satisfied, skipping upgrade: python-dateutil>=2.1 in /home/lab/anaconda3/lib/python3.6/site-packages (from jupyter-client->ipykernel) (2.6.1)
Building wheels for collected packages: backcall
  Running setup.py bdist_wheel for backcall ... done
  Stored in directory: /home/lab/.cache/pip/wheels/98/b0/dd/29e28ff615af3dda4c67cab719dd51357597eabff926976b45
Successfully built backcall
Installing collected packages: backcall, ipython, ipykernel
  Found existing installation: ipython 6.2.1
    Uninstalling ipython-6.2.1:
      Successfully uninstalled ipython-6.2.1
  Found existing installation: ipykernel 4.7.0
    Uninstalling ipykernel-4.7.0:
      Successfully uninstalled ipykernel-4.7.0
Successfully installed backcall-0.1.0 ipykernel-4.9.0 ipython-6.5.0

lab@domenico-HP-ENVY-Notebook:~/Documents/GitHub/Papillon$ pdoc papillon.py
Traceback (most recent call last):
  File "/home/lab/anaconda3/bin/pdoc", line 472, in <module>
    module = imp.load_source('__pdoc_file_module__', fp, f)
  File "/home/lab/anaconda3/lib/python3.6/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/lab/Documents/GitHub/Papillon/papillon.py", line 38, in <module>
    import seaborn as sns
  File "/home/lab/anaconda3/lib/python3.6/site-packages/seaborn/__init__.py", line 16, in <module>
    from .widgets import *
  File "/home/lab/anaconda3/lib/python3.6/site-packages/seaborn/widgets.py", line 8, in <module>
    from ipywidgets import interact, FloatSlider, IntSlider
  File "/home/lab/anaconda3/lib/python3.6/site-packages/ipywidgets/__init__.py", line 23, in <module>
    from IPython import get_ipython
  File "/home/lab/anaconda3/lib/python3.6/site-packages/IPython/__init__.py", line 55, in <module>
    from .terminal.embed import embed
  File "/home/lab/anaconda3/lib/python3.6/site-packages/IPython/terminal/embed.py", line 16, in <module>
    from IPython.terminal.interactiveshell import TerminalInteractiveShell
  File "/home/lab/anaconda3/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py", line 80, in <module>
    if not _stream or not hasattr(_stream, 'isatty') or not _stream.isatty():
ValueError: I/O operation on closed file
lab@domenico-HP-ENVY-Notebook:~/Documents/GitHub/Papillon$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.