0

I am trying to save BigQuery results as a dataframe. I tried to use to_dataframe() - Uses BigQuery tabledata.list API but its very slow. So, I am trying to use pandas_gbq but when I try to import in Jupyterlab in virtual machine then I get this error. enter image description here

I installed even using pip but getting same error. Any help?

aga
  • 3,790
  • 3
  • 11
  • 18
s_khan92
  • 969
  • 8
  • 21
  • Actually, it looks like this post will help you more accurately than my answer below: https://stackoverflow.com/questions/50239706/cannot-import-name-izip – Ben P Jan 16 '20 at 10:20
  • Can you tell me how do you run Jupyterlab on VM, have you followed any tutorial for this e.g. https://towardsdatascience.com/how-to-use-jupyter-on-a-google-cloud-vm-5ba1b473f4c2 ? – aga Jan 16 '20 at 12:47

1 Answers1

1

It looks like this package is not installed on your instance of Jupyerlab. You should install it (you only need to do this once) and run your code again.

Since you are in Jupyterlab, you can import from inside your notebook my prefixing your shell command with !.

For example: !pip install pandas

Ben P
  • 3,267
  • 4
  • 26
  • 53
  • Thanks for your answer but i already tried this and i am getting same errror. `Requirement already satisfied: pandas in /usr/local/lib/python3.5/dist-packages (0.25.3)` and then `ImportError: cannot import name 'lzip'` – s_khan92 Jan 16 '20 at 12:23
  • CheCK out my comment on your question, i feel this link is more helpful to you? – Ben P Jan 16 '20 at 12:24
  • Yes i did. But still the same problem. – s_khan92 Jan 16 '20 at 12:37
  • Which version of pandas are you using? – Ben P Jan 16 '20 at 12:40
  • Check this the answers to this question too: https://stackoverflow.com/questions/52833698/pandas-cannot-import-name-compat – Ben P Jan 16 '20 at 12:41