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

mac 10.8 qtconsole export history #2595

Closed
mbbgithub opened this issue Nov 17, 2012 · 5 comments
Closed

mac 10.8 qtconsole export history #2595

mbbgithub opened this issue Nov 17, 2012 · 5 comments

Comments

@mbbgithub
Copy link

Hello,
qtconsole menu magic "export history" failed. I tried console to write the output but it didn't complain and write the file:

history -n ~1/1-300 -f numpy_test.py
ls numpy_test.py
ls: numpy_test.py: No such file or directory

only qtconsole menu save html/xhtml works.

error for export history from the magic menu:

2012-11-16 19:55:11.834 Python[20209:1307] *** WARNING: -[NSImage compositeToPoint:operation:] is deprecated in MacOSX 10.8 and later. Please use -[NSImage drawAtPoint:fromRect:operation:fraction:] instead.
2012-11-16 19:55:11.834 Python[20209:1307] *** WARNING: -[NSImage compositeToPoint:fromRect:operation:] is deprecated in MacOSX 10.8 and later. Please use -[NSImage drawAtPoint:fromRect:operation:fraction:] instead.
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/ipython-0.13.1-py2.7.egg/IPython/frontend/qt/console/mainwindow.py", line 887, in save_magic_active_frontend
    self.active_frontend.save_magic()
  File "/Library/Python/2.7/site-packages/ipython-0.13.1-py2.7.egg/IPython/frontend/qt/console/history_console_widget.py", line 233, in save_magic
    filter='Python File (*.py);; All files (*.*)'
ValueError: too many values to unpack
@Carreau
Copy link
Member

Carreau commented Nov 17, 2012

Hi,

Mine work and generate the following magic
%save /Users/bussonniermatthias/nbconvert/eraseme.test.py 1-2 (for example)
this history -n ~1/1-300 -f numpy_test.py works also for me, and I don't quite understand the traceback.

Stupid question, but is cwd writable ? Or on a network volume ? Which version of Qt/PyQt (I was thinking of qt5 dev version)?

@mbbgithub
Copy link
Author

I don't save numpy array. I want to save history of ipython.

qt is installed by brew. version is 4.8.3 (/usr/local/Cellar/qt/4.8.3) and the working directory is home:

In [6]: pwd
Out[6]: u'/Users/mbb'

In [7]: history -n ~1/1-300 -f numpy_test.py

In [8]: ls numpy*
ls: numpy*: No such file or directory

@Carreau
Copy link
Member

Carreau commented Nov 18, 2012

%save does basically the save as %history -f , %store does write the content of variable to a file.

qt is installed by brew. version is 4.8.3 (/usr/local/Cellar/qt/4.8.3)

I use the same so it should not be that.

Could you try removing the .pyc files in
/Library/Python/2.7/site-packages/ipython-0.13.1-py2.7.egg/IPython/frontend/qt/console/
And retrying, The given error line might be wrong.

The error

filter='Python File (.py);; All files (.*)'
ValueError: too many values to unpack

make no sens.

@mbbgithub
Copy link
Author

it is still happening after deleting .pyc

sudo rm /Library/Python/2.7/site-packages/ipython-0.13.1-py2.7.egg/IPython/frontend/qt/console/*.pyc
ipython qtconsole --pylab=inline

In [4]: history 1-300 -f numpy_test.py
history -n ~1/1-300 -f numpy_test.py
ls
history -n ~1/1-300 -f numpy_test.py
history 1-300 -f numpy_test.py

In [5]: ls *.py
ls: *.py: No such file or directory

when I export history from qt menu: this is still happening too.

[IPKernelApp] To connect another client to this kernel, use:
[IPKernelApp] --existing kernel-41375.json
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/ipython-0.13.1-py2.7.egg/IPython/frontend/qt/console/mainwindow.py", line 887, in save_magic_active_frontend
    self.active_frontend.save_magic()
  File "/Library/Python/2.7/site-packages/ipython-0.13.1-py2.7.egg/IPython/frontend/qt/console/history_console_widget.py", line 233, in save_magic
    filter='Python File (*.py);; All files (*.*)'
ValueError: too many values to unpack

@minrk
Copy link
Member

minrk commented Jul 6, 2013

This is fixed in master, both menu item and magic work in 10.8, current Qt from brew.

@minrk minrk closed this as completed Jul 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants