Skip to content

Issues loading pandas after anaconda update #1713

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
stepseazy opened this issue May 10, 2017 · 9 comments
Closed

Issues loading pandas after anaconda update #1713

stepseazy opened this issue May 10, 2017 · 9 comments

Comments

@stepseazy
Copy link

Hi continuum programmers,

I've been having some trouble loading my jupyter notebook after upgrading anaconda and all packages.

Here is my code:

%load_ext autoreload
%autoreload 2
import numpy as np
import pandas as pd
from asl_data import AslDb

asl = AslDb() # initializes the database
asl.df.head() # displays the first five rows of the asl database, indexed by video and frame

And I get the following error if I reload the whole notebook:


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-9c9e5a998556> in <module>()
      2 get_ipython().magic('autoreload 2')
      3 import numpy as np
----> 4 import pandas as pd
      5 from asl_data import AslDb
      6 

/home/rik/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/rik/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/rik/anaconda3/lib/python3.5/site-packages/pandas/io/clipboard/__init__.py in <module>()
    101 
    102 
--> 103 copy, paste = determine_clipboard()
    104 
    105 __all__ = ["copy", "paste"]

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

/home/rik/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'

If I just run the cell again I get this error:

The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-3-9c9e5a998556> in <module>()
      2 get_ipython().magic('autoreload 2')
      3 import numpy as np
----> 4 import pandas as pd
      5 from asl_data import AslDb
      6 

/home/rik/anaconda3/lib/python3.5/site-packages/pandas/__init__.py in <module>()
     49 # deprecate tools.plotting, plot_params and scatter_matrix on the top namespace
     50 import pandas.tools.plotting
---> 51 plot_params = pandas.plotting._style._Options(deprecated=True)
     52 # do not import deprecate to top namespace
     53 scatter_matrix = pandas.util._decorators.deprecate(

AttributeError: module 'pandas' has no attribute 'plotting'


I'm not sure how to troubleshoot this issue...

Thanks,

Rik

@Shuolongbj
Copy link

Try reinstalling pandas? @stepseazy

@aloctavodia
Copy link

Hi,

Same problem here.I tried reinstalling pandas, qt and other stuff. Still same error. It seems that a fresh install fix the problem.

@Shuolongbj
Copy link

TRY:
uninstall :conda uninstall pandas / pip uninstall pandas
reinstall:
pip install pandas
pip install -U numpy
pip install -U scipy

@ccordoba12
Copy link

I think this requires a fix in Pandas. @TomAugspurger?

@TomAugspurger
Copy link

Check out pandas-dev/pandas#16288 and the fix in pandas-dev/pandas#16294

I think the issue was having both PyQt5 and PyQt4 installed.
That user fixed their problem by removing an empty PyQt4 package from their site-packages directory.

@ccordoba12
Copy link

ccordoba12 commented May 10, 2017

Ok, thanks for the quick answer.

Wouldn't it be better to use a shim (like qtpy) instead of trying to import directly from PyQt4? I say it because this could bite Spyder too (which nowadays runs usually in PyQt5).

@ccordoba12
Copy link

Closing as this is an upstream bug.

@TomAugspurger
Copy link

Wouldn't it be better to use a shim (like qtpy) instead of trying to import directly from PyQt4?

I don't know if the library we use for the clipboard stuff works with PyQt5.

@jzwinck
Copy link

jzwinck commented Jul 3, 2017

I think Conda still has a bug here, which is that the PyQt4 directory is not cleaned up when PyQt5 is installed by conda env update. It seems like it sticks around just because it contains __pycache__, which is not a good reason to leave it there when all other contents are removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants