question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python 3 Compatibilty?- No Module Named Altair?

See original GitHub issue

Hello,

I’m relatively new to the python world, so please forgive me if this post is not descriptive enough. When I try to load Altair into my notebook, I get an error message saying there is no module named altair, but when run Bash to check what packages I have, I have it loaded.

I am using Python 3 in virtualenv. Here is my code:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-cb7a8f302186> in <module>()
      1 import pandas as pd
----> 2 from altair import Chart

ImportError: No module named 'altair'

%%bash
pip list
altair (1.2.0)

Is Altair not compatible with Python 3? Running it with Python 2 seems to work ok.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
jakevdpcommented, Apr 5, 2020

For IPython newer than version 7.0, there is no need for the sys.executable hack. Just use the pip install magic:

%pip install altair vega_datasets
1reaction
docjshacommented, May 2, 2020

I had the same issue after installing altair in my conda env running on python 3.6. I solved it by reinstalling jupyter notebook along with altair and vega:

conda install -c conda-forge altair vega_datasets notebook vega

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Import Error - Compose - Altair Products
When I run zzz.py I receive an error in the Python Window saying 'ImportError: No Module named SetFigureSizePos' When I tried this approach ......
Read more >
Cheat Sheet: Writing Python 2-3 compatible code
Easy, clean, reliable Python 2/3 compatibility ... Python 2 and 3: from __future__ import division # (at top of module) assert 3 /...
Read more >
ModuleNotFoundError: No module named 'altair'
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'altair' How to remove the ModuleNotFo.
Read more >
altair - PyPI
Altair : A declarative statistical visualization library for Python. ... The Altair API contains no actual visualization rendering code but instead emits ...
Read more >
Installation — Altair 4.2.0 documentation
Altair has the following dependencies, all of which are installed automatically with the above installation commands: python 3.6 or newer. entrypoints.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found