Import module issue on Mac: Python - Bokeh

Hi all,

I might be overlooking something relatively simple, but I can’t seem to manage to get Bokeh to plot one of its examples provided on the website. I am not experienced with either anaconda or Bokeh.

I have installed Anaconda and installed Bokeh using conda install bokeh in Users/username/anaconda. When checked, it says it is correctly installed in this location. However, when I try to import Bokeh it does not find the module ( ImportError: No module named bokeh)

I tried to add the path ~/anaconda/bin to the path (using sys.path.append) and this does not help, even though the bokeh_server is in this location.

I am using python 2.7.10, OSX Yosemite 10.10, anaconda 1.0.0, bokeh 0.9.3.

As said, I might be missing something simple. Any help will be appreciated!

Kind regards,

Bert

You need to run the python executable from specifically from ~/anaconda/bin and then you should see:

  $ python
  Python 3.4.3 |Continuum Analytics, Inc.| (default, Mar 6 2015, 12:07:41)
  [GCC 4.2.1 (Apple Inc. build 5577)] on darwin
  Type "help", "copyright", "credits" or "license" for more information.
  >>>

If it doesn't have the banner part with "Continuum Analytics, Inc." then you are running your OS default python, which is not where the Bokeh library was installed. (One of the features of Anaconda is that it let's you install things without mucking with your system python).

Also note, sys.path is the module search path where python looks for modules to import, not a "run path" where scripts or executables are looked for. There are no python modules in ~/anaconda/bin so adding it to sys.path will not have any effect. If you run python from ~/anaconda/bin though, you should not need to to anything at all with sys.path, the Anaconda python already knows where to look for things.

Bryan

···

On Sep 11, 2015, at 9:31 AM, [email protected] wrote:

Hi all,

I might be overlooking something relatively simple, but I can't seem to manage to get Bokeh to plot one of its examples provided on the website. I am not experienced with either anaconda or Bokeh.

I have installed Anaconda and installed Bokeh using conda install bokeh in Users/username/anaconda. When checked, it says it is correctly installed in this location. However, when I try to import Bokeh it does not find the module ( ImportError: No module named bokeh)

I tried to add the path ~/anaconda/bin to the path (using sys.path.append) and this does not help, even though the bokeh_server is in this location.

I am using python 2.7.10, OSX Yosemite 10.10, anaconda 1.0.0, bokeh 0.9.3.

As said, I might be missing something simple. Any help will be appreciated!

Kind regards,

Bert

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/19eae5b0-bc8c-4f36-a045-3143cae656a5%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Bert, one quick note:

Since the Anaconda installer will prepend its /bin directory to your $PATH variable in your .bash_profile, you actually need to open a new shell or terminal window in order to pick up those changes.

-Peter

···

On Fri, Sep 11, 2015 at 10:12 AM, Bryan Van de Ven [email protected] wrote:

You need to run the python executable from specifically from ~/anaconda/bin and then you should see:

    $ python

    Python 3.4.3 |Continuum Analytics, Inc.| (default, Mar  6 2015, 12:07:41)

    [GCC 4.2.1 (Apple Inc. build 5577)] on darwin

    Type "help", "copyright", "credits" or "license" for more information.

    >>>

If it doesn’t have the banner part with “Continuum Analytics, Inc.” then you are running your OS default python, which is not where the Bokeh library was installed. (One of the features of Anaconda is that it let’s you install things without mucking with your system python).

Also note, sys.path is the module search path where python looks for modules to import, not a “run path” where scripts or executables are looked for. There are no python modules in ~/anaconda/bin so adding it to sys.path will not have any effect. If you run python from ~/anaconda/bin though, you should not need to to anything at all with sys.path, the Anaconda python already knows where to look for things.

Bryan

On Sep 11, 2015, at 9:31 AM, [email protected] wrote:

Hi all,

I might be overlooking something relatively simple, but I can’t seem to manage to get Bokeh to plot one of its examples provided on the website. I am not experienced with either anaconda or Bokeh.

I have installed Anaconda and installed Bokeh using conda install bokeh in Users/username/anaconda. When checked, it says it is correctly installed in this location. However, when I try to import Bokeh it does not find the module ( ImportError: No module named bokeh)

I tried to add the path ~/anaconda/bin to the path (using sys.path.append) and this does not help, even though the bokeh_server is in this location.

I am using python 2.7.10, OSX Yosemite 10.10, anaconda 1.0.0, bokeh 0.9.3.

As said, I might be missing something simple. Any help will be appreciated!

Kind regards,

Bert

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/19eae5b0-bc8c-4f36-a045-3143cae656a5%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/5194DBAE-F9E3-4C15-8690-456D7148726E%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Peter Wang

CTO, Co-founder

Thanks all! I managed to make it work, I guess I got a bit confused with all the paths.

Again thanks, also for your fast replies

Kind regards,

Bert

···

Op vrijdag 11 september 2015 12:27:51 UTC-3 schreef pwang:

Bert, one quick note:

Since the Anaconda installer will prepend its /bin directory to your $PATH variable in your .bash_profile, you actually need to open a new shell or terminal window in order to pick up those changes.

-Peter

On Fri, Sep 11, 2015 at 10:12 AM, Bryan Van de Ven [email protected] wrote:

You need to run the python executable from specifically from ~/anaconda/bin and then you should see:

    $ python

    Python 3.4.3 |Continuum Analytics, Inc.| (default, Mar  6 2015, 12:07:41)

    [GCC 4.2.1 (Apple Inc. build 5577)] on darwin

    Type "help", "copyright", "credits" or "license" for more information.

    >>>

If it doesn’t have the banner part with “Continuum Analytics, Inc.” then you are running your OS default python, which is not where the Bokeh library was installed. (One of the features of Anaconda is that it let’s you install things without mucking with your system python).

Also note, sys.path is the module search path where python looks for modules to import, not a “run path” where scripts or executables are looked for. There are no python modules in ~/anaconda/bin so adding it to sys.path will not have any effect. If you run python from ~/anaconda/bin though, you should not need to to anything at all with sys.path, the Anaconda python already knows where to look for things.

Bryan

On Sep 11, 2015, at 9:31 AM, [email protected] wrote:

Hi all,

I might be overlooking something relatively simple, but I can’t seem to manage to get Bokeh to plot one of its examples provided on the website. I am not experienced with either anaconda or Bokeh.

I have installed Anaconda and installed Bokeh using conda install bokeh in Users/username/anaconda. When checked, it says it is correctly installed in this location. However, when I try to import Bokeh it does not find the module ( ImportError: No module named bokeh)

I tried to add the path ~/anaconda/bin to the path (using sys.path.append) and this does not help, even though the bokeh_server is in this location.

I am using python 2.7.10, OSX Yosemite 10.10, anaconda 1.0.0, bokeh 0.9.3.

As said, I might be missing something simple. Any help will be appreciated!

Kind regards,

Bert

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/19eae5b0-bc8c-4f36-a045-3143cae656a5%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/5194DBAE-F9E3-4C15-8690-456D7148726E%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.


Peter Wang

CTO, Co-founder