Skip to content

Pandas Fails Test #23088

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
rickhg12hs opened this issue Oct 11, 2018 · 11 comments
Closed

Pandas Fails Test #23088

rickhg12hs opened this issue Oct 11, 2018 · 11 comments

Comments

@rickhg12hs
Copy link

Code Sample, a copy-pastable example if possible

$ python3 -m jupyter console
Jupyter console 6.0.0

Python 3.6.5 (default, Apr  4 2018, 15:09:05) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.0.1 -- An enhanced Interactive Python. Type '?' for help.



In [1]: import pandas as pd                                                                         

In [2]: pd.test()                                                                                   
running: pytest --skip-slow --skip-network /home/rick/.local/lib/python3.6/site-packages/pandas
======================================= test session starts ========================================
platform linux -- Python 3.6.5, pytest-3.2.3, py-1.4.34, pluggy-0.4.0
rootdir: /home/rick, inifile:
collected 31220 items / 7 errors / 3 skipped

============================================== ERRORS ==============================================
_______ ERROR collecting .local/lib/python3.6/site-packages/pandas/tests/test_categorical.py _______
ImportError while importing test module '/home/rick/.local/lib/python3.6/site-packages/pandas/tests/test_categorical.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
.local/lib/python3.6/site-packages/pandas/tests/test_categorical.py:29: in <module>
    from pandas.core.categorical import _recode_for_categories
E   ImportError: cannot import name '_recode_for_categories'
----------------------------------------- Captured stderr ------------------------------------------
/home/rick/.local/lib/python3.6/site-packages/pandas/tests/test_categorical.py:29: FutureWarning: 'pandas.core' is private. Use 'pandas.Categorical'
  from pandas.core.categorical import _recode_for_categories
_________ ERROR collecting .local/lib/python3.6/site-packages/pandas/tests/test_panel4d.py _________
.local/lib/python3.6/site-packages/pandas/tests/test_panel4d.py:13: in <module>
    from pandas.core.panel4d import Panel4D
.local/lib/python3.6/site-packages/pandas/core/panel4d.py:43: in <module>
    """))
.local/lib/python3.6/site-packages/pandas/core/panelnd.py:47: in create_nd_panel_factory
    aliases=aliases, slicers=slices)
.local/lib/python3.6/site-packages/pandas/core/generic.py:290: in _setup_axes
    set_axis(a, i)
.local/lib/python3.6/site-packages/pandas/core/generic.py:281: in set_axis
    setattr(cls, a, properties.AxisProperty(i, docs.get(a, a)))
E   AttributeError: 'NoneType' object has no attribute 'get'
____ ERROR collecting .local/lib/python3.6/site-packages/pandas/tests/groupby/test_aggregate.py ____
ImportError while importing test module '/home/rick/.local/lib/python3.6/site-packages/pandas/tests/groupby/test_aggregate.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
.local/lib/python3.6/site-packages/pandas/tests/groupby/test_aggregate.py:22: in <module>
    from pandas.core.groupby import SpecificationError, DataError
E   ImportError: cannot import name 'SpecificationError'
______ ERROR collecting .local/lib/python3.6/site-packages/pandas/tests/scalar/test_period.py ______
.local/lib/python3.6/site-packages/pandas/tests/scalar/test_period.py:13: in <module>
    from pandas._libs import tslib, period as libperiod
pandas/_libs/period.pyx:1: in init pandas._libs.period
    ???
E   AttributeError: module 'pandas._libs.tslib' has no attribute '__pyx_capi__'
__ ERROR collecting .local/lib/python3.6/site-packages/pandas/tests/scalar/test_period_asfreq.py ___
ImportError while importing test module '/home/rick/.local/lib/python3.6/site-packages/pandas/tests/scalar/test_period_asfreq.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
.local/lib/python3.6/site-packages/pandas/tests/scalar/test_period_asfreq.py:4: in <module>
    from pandas.tseries.frequencies import _period_code_map
E   ImportError: cannot import name '_period_code_map'
_______ ERROR collecting .local/lib/python3.6/site-packages/pandas/tests/sparse/test_list.py _______
ImportError while importing test module '/home/rick/.local/lib/python3.6/site-packages/pandas/tests/sparse/test_list.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
.local/lib/python3.6/site-packages/pandas/tests/sparse/test_list.py:6: in <module>
    from pandas.core.sparse.api import SparseList, SparseArray
E   ImportError: cannot import name 'SparseList'
_____ ERROR collecting .local/lib/python3.6/site-packages/pandas/tests/tseries/test_offsets.py _____
ImportError while importing test module '/home/rick/.local/lib/python3.6/site-packages/pandas/tests/tseries/test_offsets.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
.local/lib/python3.6/site-packages/pandas/tests/tseries/test_offsets.py:15: in <module>
    from pandas.tseries.frequencies import (_offset_map, get_freq_code,
E   ImportError: cannot import name '_get_freq_str'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 7 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=============================== 3 skipped, 7 error in 10.41 seconds ================================
An exception has occurred, use %tb to see the full traceback.

SystemExit: 2

/home/rick/.local/lib/python3.6/site-packages/IPython/core/interactiveshell.py:3273: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.
  warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)

In [3]:              

Problem description

Test fails promptly.

Expected Output

All Tests passing

Output of pd.show_versions()

[paste the output of pd.show_versions() here below this line]
In [3]: pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 3.6.5.final.0
python-bits: 64
OS: Linux
OS-release: 4.16.11-100.fc26.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8

pandas: 0.23.4
pytest: 3.2.3
pip: 18.1
setuptools: 40.4.3
Cython: None
numpy: 1.15.2
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: 7.0.1
sphinx: None
patsy: 0.5.0
dateutil: 2.7.3
pytz: 2018.5
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 3.0.0
openpyxl: None
xlrd: 1.1.0
xlwt: None
xlsxwriter: None
lxml: 4.2.5
bs4: 4.6.0
html5lib: 1.0.1
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None

@TomAugspurger
Copy link
Contributor

How'd you install pandas? It looks like you may have multiple versions installed in that environment.

@rickhg12hs
Copy link
Author

$ python3 -m pip install -UI --user pandas

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Oct 11, 2018 via email

@rickhg12hs
Copy link
Author

$ python3 -m pip list
Package                      Version   
---------------------------- ----------
absl-py                      0.5.0     
aiohttp                      2.2.5     
aiohttp-cors                 0.5.3     
asn1crypto                   0.23.0    
astor                        0.7.1     
astropy                      1.3.3     
async-timeout                1.2.0     
backcall                     0.1.0     
Beaker                       1.5.4     
beautifulsoup4               4.6.0     
binwalk                      2.1.1     
bleach                       3.0.2     
blessings                    1.7       
blivet                       2.1.11    
blivet-gui                   2.1.7     
bottle                       0.12.13   
Bottleneck                   1.2.1     
Brlapi                       0.6.6     
btrfs                        8         
ccsm                         0.8.14    
certifi                      2018.8.24 
cffi                         1.9.1     
chardet                      3.0.4     
chrome-gnome-shell           0.0.0     
cloudpickle                  0.6.1     
colorama                     0.4.0     
configobj                    5.0.6     
coverage                     4.4.1     
cryptography                 2.0.2     
cssselect                    0.9.2     
cupshelpers                  1.0       
cycler                       0.10.0    
dask                         0.19.4    
decorator                    4.3.0     
defusedxml                   0.5.0     
docutils                     0.13.1    
dspace                       2.0       
entrypoints                  0.2.3     
fail2ban                     0.9.7     
fastcache                    1.0.2     
Forensic1394                 0.1       
frescobaldi                  3.0.0     
fros                         1.1       
fusion-icon                  0.2.4     
gast                         0.2.0     
Glances                      3.0.2     
gmpy2                        2.0.8     
gns3-gui                     2.1.0rc1  
gns3-net-converter           1.3.0     
gns3-server                  2.1.0rc1  
gpg                          1.8.0     
graphviz                     0.9       
grpcio                       1.15.0    
h5py                         2.8.0     
html5lib                     1.0.1     
httplib2                     0.10.3    
humanize                     0.5.1     
idna                         2.7       
imageio                      2.4.1     
inception                    0.4.0     
iniparse                     0.4       
initial-setup                0.3.46    
IPy                          0.81      
ipykernel                    5.1.0     
ipython                      7.0.1     
ipython-genutils             0.2.0     
ipywidgets                   7.4.2     
isc                          2.0       
javapackages                 4.7.0     
jedi                         0.13.1    
Jinja2                       2.10      
joblib                       0.11      
jsonschema                   2.6.0     
jupyter                      1.0.0     
jupyter-client               5.2.3     
jupyter-console              6.0.0     
jupyter-core                 4.4.0     
jupyterlab                   0.35.0    
jupyterlab-launcher          0.13.1    
jupyterlab-server            0.2.0     
Keras-Applications           1.0.6     
Keras-Preprocessing          1.0.5     
kismon                       0.8.1     
kiwisolver                   1.0.1     
langtable                    0.0.37    
lightdm-gtk-greeter-settings 1.2.2     
lxml                         4.2.5     
Mako                         1.0.6.dev0
Markdown                     3.0.1     
Markups                      2.0.0     
MarkupSafe                   1.0       
matplotlib                   3.0.0     
mistune                      0.8.4     
mock                         2.0.0     
mpmath                       0.19      
multidict                    3.3.0     
nbconvert                    5.4.0     
nbformat                     4.4.0     
networkx                     2.2       
nose                         1.3.7     
notebook                     5.7.0     
ntplib                       0.3.3     
numexpr                      2.6.8     
numpy                        1.15.2    
oaiharvest                   3.0.0     
olefile                      0.45.1    
openshot-qt                  2.4.1     
ordered-set                  2.0.0     
pandas                       0.23.4    
pandocfilters                1.4.2     
parso                        0.3.1     
path.py                      5.2       
patsy                        0.5.0     
pbr                          4.3.0     
pexpect                      4.6.0     
pickleshare                  0.7.5     
pid                          2.1.1     
Pillow                       5.3.0     
pip                          18.1      
pipdeptree                   0.13.1    
plotly                       3.3.0     
ply                          3.9       
prometheus-client            0.4.1     
prompt-toolkit               2.0.5     
protobuf                     3.6.1     
psutil                       5.4.7     
ptyprocess                   0.6.0     
pwquality                    1.3.0     
py                           1.4.34    
pycparser                    2.14      
pycups                       1.9.72    
pycurl                       7.43.0    
pydot                        1.0.29    
pyenchant                    1.6.10    
pyglet                       1.2.4     
Pygments                     2.2.0     
pygobject                    3.24.1    
pygpgme                      0.3       
pyinotify                    0.9.6     
PyIscsi                      1.0       
pykickstart                  2.35      
pyoai                        2.5.0     
pyOpenSSL                    16.2.0    
pyparsing                    2.2.2     
pyparted                     3.10.7    
PySocks                      1.6.7     
pystray                      0.14.3    
pytest                       3.2.3     
python-augeas                0.5.0     
python-dateutil              2.7.3     
python-dmidecode             3.12.2    
python-ly                    0.9.5     
python-meh                   0.43      
python-poppler-qt5           0.24.1    
python-xlib                  0.23      
pytoml                       0.1.14    
pytz                         2018.5    
pyudev                       0.21.0    
PyWavelets                   1.0.1     
pyxdg                        0.25      
PyYAML                       3.12      
pyzmq                        17.1.2    
qtconsole                    4.4.1     
raven                        6.0.0     
readchar                     2.0.1     
regex                        2018.2.21 
registries                   0.1       
reportlab                    3.3.0     
requests                     2.19.1    
requests-file                1.4       
requests-ftp                 0.3.1     
ReText                       7.0.0     
retrying                     1.3.3     
rpm-python                   4.13.1    
rpmconf                      1.0.19    
scikit-image                 0.14.1    
scikit-learn                 0.20.0    
scipy                        1.1.0     
seaborn                      0.9.0     
Send2Trash                   1.5.0     
sepolicy                     1.1       
setools                      4.1.0     
setroubleshoot               1.1       
setuptools                   40.4.3    
sh                           1.12.14   
simple-ccsm                  0.8.14.1  
simplegeneric                0.8.1     
simplejson                   3.10.0    
six                          1.11.0    
sklearn                      0.0       
slip                         0.6.4     
slip.dbus                    0.6.4     
sos                          3.5       
SSSDConfig                   1.16.1    
statsmodels                  0.9.0     
sympy                        1.1.1     
systemd-python               234       
tensorboard                  1.11.0    
tensorflow                   1.12.0rc0 
termcolor                    1.1.0     
terminado                    0.8.1     
testpath                     0.4.2     
textile                      2.3.16    
Theano                       0.9.0     
tldr                         0.4.4     
toolz                        0.9.0     
tornado                      5.1.1     
traitlets                    4.3.2     
urllib3                      1.23      
veusz                        1.27      
wcwidth                      0.1.7     
webencodings                 0.5.1     
Werkzeug                     0.14.1    
wheel                        0.32.1    
widgetsnbextension           3.4.2     
wrapt                        1.10.10   
xlrd                         1.1.0     
yarl                         0.12.0    
youtube-dl                   2018.10.5 
yumex-dnf                    4.3.2     
zipstream                    1.1.4     

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Oct 11, 2018 via email

@rickhg12hs
Copy link
Author

Well, I've never created a virtual environment before and my first attempt failed.

$ python3 -m venv --clear  python_env
Error: Command '['/home/rick/tmp/python_env/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.

There is no error with:

$ python3 -m venv --clear --without-pip  python_env

But I don't know how to install any packages without pip.

Can you help me with this?

@rickhg12hs
Copy link
Author

... OK, I just copied the pip directory to the virtual environments 'lib/... dir and installed all the test dependencies. The tests are running now. An improvement!

@rickhg12hs
Copy link
Author

In the virtual environment, the tests completed with:

=== 76 failed, 25268 passed, 3684 skipped, 77 xfailed, 26 xpassed, 95 warnings in 359.27 seconds ===

@TomAugspurger
Copy link
Contributor

Since this works in a new env, I'm guessing it was an issue with the upgrade. Most likely pip or setuptools failed to remove or update a file from the old install. Not sure if it's a pandas or pip issue, but I'm inclined to just ignore it.

@rickhg12hs
Copy link
Author

Hmmm, looks like I should setup and use a virtual environment for pandas. I don't understand the problem really, and I don't want mystery errors later.

@TomAugspurger
Copy link
Contributor

Separate environments are typically a good idea.

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

2 participants