Skip to content

Cannot import pandas after update of conda (PyQt4.QtGui import error) #16498

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

Closed
Auerilas opened this issue May 25, 2017 · 1 comment
Closed
Labels
Duplicate Report Duplicate issue or pull request

Comments

@Auerilas
Copy link

Recently updated conda, using conda update --all. I have conda forge, so I should be using the latest recipes. On attempting to import pandas:

Code Sample, a copy-pastable example if possible

import pandas
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-3-d6ac987968b6> in <module>()
----> 1 import pandas

/home/auerilas/anaconda3/lib/python3.5/site-packages/pandas/__init__.py in <module>()
     56 
     57 from pandas.util._print_versions import show_versions
---> 58 from pandas.io.api import *
     59 from pandas.util._tester import test
     60 import pandas.testing

/home/auerilas/anaconda3/lib/python3.5/site-packages/pandas/io/api.py in <module>()
      6 
      7 from pandas.io.parsers import read_csv, read_table, read_fwf
----> 8 from pandas.io.clipboard.clipboard import read_clipboard
      9 from pandas.io.excel import ExcelFile, ExcelWriter, read_excel
     10 from pandas.io.pytables import HDFStore, get_store, read_hdf

/home/auerilas/anaconda3/lib/python3.5/site-packages/pandas/io/clipboard/__init__.py in <modu$
e>()
    101 
    102 
--> 103 copy, paste = determine_clipboard()
    104 
    105 __all__ = ["copy", "paste"]

/home/auerilas/anaconda3/lib/python3.5/site-packages/pandas/io/clipboard/__init__.py in deter$
ine_clipboard()
     74             pass
     75         else:
---> 76             return init_qt_clipboard()
     77 
     78         if _executable_exists("xclip"):

/home/auerilas/anaconda3/lib/python3.5/site-packages/pandas/io/clipboard/clipboards.py in init
_qt_clipboard()
     47 def init_qt_clipboard():
     48     # $DISPLAY should exist
---> 49     from PyQt4.QtGui import QApplication
     50 
     51     # use the global instance if it exists

ImportError: No module named 'PyQt4.QtGui'

I can run this following:

In [14]: import PyQt5
In [15]: import PyQt4
In [16]: import PyQt5.QtGui
In [17]: import PyQt4.QtGui
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-17-43468025f39e> in <module>()
----> 1 import PyQt4.QtGui

ImportError: No module named 'PyQt4.QtGui'

Any thoughts on how to proceed from here?

@TomAugspurger
Copy link
Contributor

See #16322 (and some linked issues).

This is fixed in master and we'll be release 0.20.2 before too long. In the meantime, it seems like removing the pyqt4 directory in your site-packages should fix the problem.

@TomAugspurger TomAugspurger added the Duplicate Report Duplicate issue or pull request label May 25, 2017
@TomAugspurger TomAugspurger added this to the No action milestone May 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request
Projects
None yet
Development

No branches or pull requests

2 participants