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

(I)Python consoles are not setting PyQt API to #2 #3078

Closed
ronanpaixao opened this issue Mar 23, 2016 · 0 comments
Closed

(I)Python consoles are not setting PyQt API to #2 #3078

ronanpaixao opened this issue Mar 23, 2016 · 0 comments

Comments

@ronanpaixao
Copy link
Contributor

When using a console, either just Python or IPython consoles, it's not possible to set PyQt's APIs to v2 (important when using Python 2.7-) because sip complains PyQt's API was already set.

What steps will reproduce the problem?

  1. Open a console
  2. Paste this code:
import sip
sip.setapi("QString", 2)

What is the expected output? What do you see instead?

I expected the API to be set smoothly, without problems. Since each console is a new process, this shouldn't be a problem. However, one can only set the API before importing anything from PyQt, otherwise a ValueError is raised:

Traceback (most recent call last):

  File "<ipython-input-1-d148d852a0a4>", line 2, in <module>
    sip.setapi("QString", 2)

ValueError: API 'QString' has already been set to version 1

Please provide any additional information below

First I noticed that sip.getapi("QString") would return 1 in a console. However, if running it in the Internal console, I get a 2.

I've also had some binary-search "fun" with git and tracked the regression to Steven Silvester's branch, on commit
c701aa6 - Fix circular import

The previous commit:
cba88eb - Fix required version adding
did not pose the same problem.

The branch was merged in commit
b60139e - Merge pull request #2932 from blink1073/async-introspection - PR: Asynchronous introspection for the Editor

Versions and main components

  • Spyder Version: 3.0.0dev
  • Python Version: Python 2.7.11 |Anaconda 2.5.0 (64-bit)| (default, Jan 29 2016, 14:26:21) [MSC v.1500 64 bit (AMD64)] on win32
  • Operating system: Windows 8.1 64-bit

Dependencies

Please go to the menu entry Help > Optional Dependencies (or
Help > Dependencies), press the button Copy to clipboard
and paste the contents below:
jedi >=0.8.1 : 0.9.0 (OK)
matplotlib >=1.0: 1.5.1 (OK)
nbconvert >=4.0 : 4.1.0 (OK)
numpy >=1.7 : 1.10.4 (OK)
pandas >=0.13.1 : 0.17.1 (OK)
pep8 >=0.6 : 1.7.0 (OK)
pyflakes >=0.5.0: 1.0.0 (OK)
pygments >=1.6 : 2.1 (OK)
pylint >=0.25 : 1.5.4 (OK)
qtconsole >=4.0 : 4.1.1 (OK)
rope >=0.9.4 : 0.9.4 (OK)
sphinx >=0.6.6 : 1.3.5 (OK)
sympy >=0.7.3 : 0.7.7.dev (OK)

@ccordoba12 ccordoba12 changed the title (I)Python console is loading PyQt without being asked for (I)Python consoles are not setting PyQt API to #2 Mar 23, 2016
@ccordoba12 ccordoba12 added this to the v3.0beta3 milestone Mar 23, 2016
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

2 participants