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

Installation issue -- pandas.io has no attribute parquet #40

Closed
illdopejake opened this issue May 15, 2019 · 6 comments
Closed

Installation issue -- pandas.io has no attribute parquet #40

illdopejake opened this issue May 15, 2019 · 6 comments

Comments

@illdopejake
Copy link

Package looks great, recently try to install out of curiosity!

I created a new python 3.6 environment and installed the package with the [io] option. I did this both through git and pip install. Both times, when trying to import, I got the following error:

AttributeError                            Traceback (most recent call last)
<ipython-input-1-1a564bd5acfd> in <module>()
----> 1 import abagen

~/anaconda2/envs/py3/lib/python3.6/importlib/_bootstrap.py in _find_and_load(name, import_)

~/anaconda2/envs/py3/lib/python3.6/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

~/anaconda2/envs/py3/lib/python3.6/importlib/_bootstrap.py in _load_unlocked(spec)

~/anaconda2/envs/py3/lib/python3.6/importlib/_bootstrap.py in _load_backward_compatible(spec)

~/anaconda2/envs/py3/lib/python3.6/site-packages/abagen-0.0.1-py3.6.egg/abagen/__init__.py in <module>()
      5 from .info import __version__
      6 
----> 7 from abagen.allen import get_expression_data
      8 from abagen.correct import keep_stable_genes, remove_distance
      9 from abagen.datasets import fetch_microarray, fetch_desikan_killiany

~/anaconda2/envs/py3/lib/python3.6/importlib/_bootstrap.py in _find_and_load(name, import_)

~/anaconda2/envs/py3/lib/python3.6/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

~/anaconda2/envs/py3/lib/python3.6/importlib/_bootstrap.py in _load_unlocked(spec)

~/anaconda2/envs/py3/lib/python3.6/importlib/_bootstrap.py in _load_backward_compatible(spec)

~/anaconda2/envs/py3/lib/python3.6/site-packages/abagen-0.0.1-py3.6.egg/abagen/allen.py in <module>()
     12 from scipy.spatial.distance import cdist
     13 
---> 14 from abagen import datasets, io, process, utils
     15 
     16 

~/anaconda2/envs/py3/lib/python3.6/importlib/_bootstrap.py in _find_and_load(name, import_)

~/anaconda2/envs/py3/lib/python3.6/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

~/anaconda2/envs/py3/lib/python3.6/importlib/_bootstrap.py in _load_unlocked(spec)

~/anaconda2/envs/py3/lib/python3.6/importlib/_bootstrap.py in _load_backward_compatible(spec)

~/anaconda2/envs/py3/lib/python3.6/site-packages/abagen-0.0.1-py3.6.egg/abagen/datasets.py in <module>()
     16 import requests
     17 from sklearn.utils import Bunch
---> 18 from abagen import io
     19 
     20 WELL_KNOWN_IDS = Recoder(

~/anaconda2/envs/py3/lib/python3.6/importlib/_bootstrap.py in _find_and_load(name, import_)

~/anaconda2/envs/py3/lib/python3.6/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

~/anaconda2/envs/py3/lib/python3.6/importlib/_bootstrap.py in _load_unlocked(spec)

~/anaconda2/envs/py3/lib/python3.6/importlib/_bootstrap.py in _load_backward_compatible(spec)

~/anaconda2/envs/py3/lib/python3.6/site-packages/abagen-0.0.1-py3.6.egg/abagen/io.py in <module>()
     12 import pandas as pd
     13 try:
---> 14     eng = pd.io.parquet.get_engine('fastparquet')
     15     assert 'SNAPPY' in eng.api.compression.compressions
     16     use_parq = True

AttributeError: module 'pandas.io' has no attribute 'parquet'

Apologies if this is a silly problem on my end. Let me know if I can help or provide more information!

@rmarkello
Copy link
Owner

Sorry to hear this is happening! I'm not totally sure the cause, but definitely interesting in figuring out what's up. Would you mind giving me the output you get running the following code:

import pandas as pd
pd.show_versions()

That might help narrow things down a bit!

@illdopejake
Copy link
Author

Heck yeah!

INSTALLED VERSIONS
------------------
commit: None
python: 3.6.2.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.0-145-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_CA.UTF-8
LOCALE: en_CA.UTF-8

pandas: 0.20.3
pytest: 3.2.2
pip: 9.0.1
setuptools: 36.4.0
Cython: None
numpy: 1.15.4
scipy: 1.1.0
xarray: None
IPython: 6.1.0
sphinx: None
patsy: 0.4.1
dateutil: 2.6.1
pytz: 2017.2
blosc: None
bottleneck: None
tables: 3.4.3
numexpr: 2.6.2
feather: None
matplotlib: 2.0.2
openpyxl: None
xlrd: 1.1.0
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: 0.999999999
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.9.6
s3fs: None
pandas_gbq: None
pandas_datareader: None

@rmarkello
Copy link
Owner

Perfect!

For some reason your pandas install is a few versions old (0.20.3, where the current version is 0.24.2), and the ability to read parquet files only came about in 0.21.0, which explains the error. Could you try updating your pandas install (if you're comfortable with that) and try importing again and let me know how that goes?

In the meantime I'll update the install requirements for abagen to reflect the minimum version dependency and try and implement a few other fixes to catch these sorts of errors.

@illdopejake
Copy link
Author

That was indeed the problem, it seems! It also didn't help that I had created the new environment with conda, so Pip and Conda packages were getting crossed up.

Creating a new environment from scratch using virtualenv did the trick!

Thanks for the rapid and super helpful response -- can't wait to get jiggy with Abagen

@rmarkello
Copy link
Owner

Great, glad that worked! I'll close this issue as soon as I merge in the changes to prevent this problem in the future 👍 Thanks for pointing it out, and let me know if you run into any other problems as you work with the package!

@rmarkello
Copy link
Owner

Alright, I think this was closed with #41. If any more issues pop up then we can address them as they're discovered!

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