I have no idea why I'm getting this error, as I looked in the pandas folder and there is clearly a subfolder called plotting. please help.
RIk
import os
import math
import numpy as np
import h5py
import tqdm as tqdm
import keras
from keras.models import Sequential, Model
from keras.layers.core import Dense, Dropout, Activation, Flatten, Reshape
from keras.layers import Embedding, Input, merge
from keras.layers.recurrent import SimpleRNN, LSTM
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.optimizers import SGD, Adam, RMSprop
import sklearn.metrics as metrics
/home/rik/anaconda3/bin/python /home/rik/PycharmProjects/self_driving/self_driving.py
Using TensorFlow backend.
Traceback (most recent call last):
File "/home/rik/PycharmProjects/self_driving/self_driving.py", line 6, in
import keras
File "/home/rik/anaconda3/lib/python3.5/site-packages/keras/__init__.py", line 3, in
from . import activations
File "/home/rik/anaconda3/lib/python3.5/site-packages/keras/activations.py", line 3, in
from . import backend as K
File "/home/rik/anaconda3/lib/python3.5/site-packages/keras/backend/__init__.py", line 64, in
from .tensorflow_backend import *
File "/home/rik/anaconda3/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py", line 1, in
import tensorflow as tf
File "/home/rik/anaconda3/lib/python3.5/site-packages/tensorflow/__init__.py", line 24, in
from tensorflow.python import *
File "/home/rik/anaconda3/lib/python3.5/site-packages/tensorflow/python/__init__.py", line 77, in
from tensorflow.python.estimator import estimator_lib as estimator
File "/home/rik/anaconda3/lib/python3.5/site-packages/tensorflow/python/estimator/estimator_lib.py", line 24, in
from tensorflow.python.estimator.inputs import inputs
File "/home/rik/anaconda3/lib/python3.5/site-packages/tensorflow/python/estimator/inputs/inputs.py", line 23, in
from tensorflow.python.estimator.inputs.pandas_io import pandas_input_fn
File "/home/rik/anaconda3/lib/python3.5/site-packages/tensorflow/python/estimator/inputs/pandas_io.py", line 28, in
import pandas as pd
File "/home/rik/anaconda3/lib/python3.5/site-packages/pandas/__init__.py", line 51, in
plot_params = pandas.plotting._style._Options(deprecated=True)
AttributeError: module 'pandas' has no attribute 'plotting'Process finished with exit code 1
so this doesn't work?
(pandas) bash-3.2$ python -c "import pandas; print(pandas.plotting.scatter_matrix)"
<function scatter_matrix at 0x10f6b5a60>
show pd.show_versions()
I'm getting this error now when I try to import pandas. My pyqt is 5.6.0, not sure if that is the problem:
In [1]: import pandas
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-d6ac987968b6> in <module>()
----> 1 import pandas
/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'
See https://github.com/pandas-dev/pandas/issues/16322 then.
Can you check if you have a (maybe empty) PyQt4 directory in your site-packages? Removing that should fix it.
Fixed it thanks.
-Rik
for me updating pandas helped, but removing the qt folder didn't
I was using pandas version 0.23.3 when I was getting this exact error. Was able to fix this by re-ordering my import statements.
I was getting this error when trying to import a file that imported pandas itself. By importing that file FIRST and the rest later fixed the issue for me.
I have no idea why I'm getting this error, as I looked in the pandas folder and there is clearly a subfolder called plotting. please help.
RIk
import os
import math
import numpy as np
import h5py
import tqdm as tqdm
import keras
from keras.models import Sequential, Model
from keras.layers.core import Dense, Dropout, Activation, Flatten, Reshape
from keras.layers import Embedding, Input, merge
from keras.layers.recurrent import SimpleRNN, LSTM
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.optimizers import SGD, Adam, RMSprop
import sklearn.metrics as metrics/home/rik/anaconda3/bin/python /home/rik/PycharmProjects/self_driving/self_driving.py
Using TensorFlow backend.
Traceback (most recent call last):
File "/home/rik/PycharmProjects/self_driving/self_driving.py", line 6, in
import keras
File "/home/rik/anaconda3/lib/python3.5/site-packages/keras/init.py", line 3, in
from . import activations
File "/home/rik/anaconda3/lib/python3.5/site-packages/keras/activations.py", line 3, in
from . import backend as K
File "/home/rik/anaconda3/lib/python3.5/site-packages/keras/backend/init.py", line 64, in
from .tensorflow_backend import *
File "/home/rik/anaconda3/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py", line 1, in
import tensorflow as tf
File "/home/rik/anaconda3/lib/python3.5/site-packages/tensorflow/init.py", line 24, in
from tensorflow.python import *
File "/home/rik/anaconda3/lib/python3.5/site-packages/tensorflow/python/init.py", line 77, in
from tensorflow.python.estimator import estimator_lib as estimator
File "/home/rik/anaconda3/lib/python3.5/site-packages/tensorflow/python/estimator/estimator_lib.py", line 24, in
from tensorflow.python.estimator.inputs import inputs
File "/home/rik/anaconda3/lib/python3.5/site-packages/tensorflow/python/estimator/inputs/inputs.py", line 23, in
from tensorflow.python.estimator.inputs.pandas_io import pandas_input_fn
File "/home/rik/anaconda3/lib/python3.5/site-packages/tensorflow/python/estimator/inputs/pandas_io.py", line 28, in
import pandas as pd
File "/home/rik/anaconda3/lib/python3.5/site-packages/pandas/init.py", line 51, in
plot_params = pandas.plotting._style._Options(deprecated=True)
AttributeError: module 'pandas' has no attribute 'plotting'
Process finished with exit code 1
you need to update pandas version then run the programme and you will find error remove automatically.
Not sure if mine is related, but if I sys.modules.pop('pandas'), then try import pandas, I get the error. On Pandas 0.23.4, python 3.6.
I have no idea why I'm getting this error, as I looked in the pandas folder and there is clearly a subfolder called plotting. please help.
RIk
import os
import math
import numpy as np
import h5py
import tqdm as tqdm
import keras
from keras.models import Sequential, Model
from keras.layers.core import Dense, Dropout, Activation, Flatten, Reshape
from keras.layers import Embedding, Input, merge
from keras.layers.recurrent import SimpleRNN, LSTM
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.optimizers import SGD, Adam, RMSprop
import sklearn.metrics as metrics/home/rik/anaconda3/bin/python /home/rik/PycharmProjects/self_driving/self_driving.py
Using TensorFlow backend.
Traceback (most recent call last):
File "/home/rik/PycharmProjects/self_driving/self_driving.py", line 6, in
import keras
File "/home/rik/anaconda3/lib/python3.5/site-packages/keras/init.py", line 3, in
from . import activations
File "/home/rik/anaconda3/lib/python3.5/site-packages/keras/activations.py", line 3, in
from . import backend as K
File "/home/rik/anaconda3/lib/python3.5/site-packages/keras/backend/init.py", line 64, in
from .tensorflow_backend import *
File "/home/rik/anaconda3/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py", line 1, in
import tensorflow as tf
File "/home/rik/anaconda3/lib/python3.5/site-packages/tensorflow/init.py", line 24, in
from tensorflow.python import *
File "/home/rik/anaconda3/lib/python3.5/site-packages/tensorflow/python/init.py", line 77, in
from tensorflow.python.estimator import estimator_lib as estimator
File "/home/rik/anaconda3/lib/python3.5/site-packages/tensorflow/python/estimator/estimator_lib.py", line 24, in
from tensorflow.python.estimator.inputs import inputs
File "/home/rik/anaconda3/lib/python3.5/site-packages/tensorflow/python/estimator/inputs/inputs.py", line 23, in
from tensorflow.python.estimator.inputs.pandas_io import pandas_input_fn
File "/home/rik/anaconda3/lib/python3.5/site-packages/tensorflow/python/estimator/inputs/pandas_io.py", line 28, in
import pandas as pd
File "/home/rik/anaconda3/lib/python3.5/site-packages/pandas/init.py", line 51, in
plot_params = pandas.plotting._style._Options(deprecated=True)
AttributeError: module 'pandas' has no attribute 'plotting'
Process finished with exit code 1
Even I am having the same problem,I tried doing in your way but the current version already adds with try and catch block for pyqt.Please reply me I need to have a solution for this also where can find my pyqt if installed or not?
AttributeError: partially initialized module 'pandas' has no attribute 'plotting' (most likely due to a circular import)
See #16322 then.
Can you check if you have a (maybe empty)
PyQt4directory in your site-packages? Removing that should fix it.
Where can I find if my pyqt package is available or not? Please I need to have a solution for this
I was using pandas version
0.23.3when I was getting this exact error. Was able to fix this by re-ordering my import statements.I was getting this error when trying to import a file that imported pandas itself. By importing that file FIRST and the rest later fixed the issue for me.
I didn't understand what you were saying.please I need to have a solution for these
AttributeError: partially initialized module 'pandas' has no attribute 'plotting' (most likely due to a circular import)
from pandas.plotting._misc import scatter_matrix
then don't use pd.scatter_matrix or pandas.scatter_matrix
u can call direct scatter_matrix
eg - cmap = cm.get_cmap('gnuplot')
scatter = scatter_matrix(X, c = y, marker = 'o', s=40, hist_kwds={'bins':15}, figsize=(9,9), cmap = cmap)
plt.suptitle('Scatter-matrix for each input variable')
plt.savefig('fruits_scatter_matrix')
plt.show()
Most helpful comment
See https://github.com/pandas-dev/pandas/issues/16322 then.
Can you check if you have a (maybe empty)
PyQt4directory in your site-packages? Removing that should fix it.