PyJulia cannot import Julia modules

370 views
Skip to first unread message

Verdi March

unread,
Jun 19, 2015, 8:34:56 AM6/19/15
to julia...@googlegroups.com
Hi,

I'm trying to call Julia functions from Python.

I follow the PyJulia example by Jake Bolewski (here), but I couldn't get it to work:

$ python -c 'from julia import Clustering'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name Clustering

The Clustering module is already installed; I can use it from within Julia. I'm not sure what steps are still missing, but it'd be great if anyone can shed some lights.

Regards,
Verdi

Stefan Karpinski

unread,
Jun 19, 2015, 10:32:23 AM6/19/15
to Julia Users
You probably need to load the Clustering package in Julia first. Arguably, that should happen automatically when doing `from julia import Clustering` with PyJulia.

Verdi March

unread,
Jun 19, 2015, 12:56:08 PM6/19/15
to julia...@googlegroups.com
Thanks, Stefan.

I can confirm that once Julia loads the Clustering module, then Python can import this module.

import julia
j = julia.Julia()
j.call("using Clustering")
from julia import Clustering

Regards,
Verdi

Stefan Karpinski

unread,
Jun 19, 2015, 1:01:06 PM6/19/15
to Julia Users
Great. Would you mind opening an issue with PyJulia requesting this feature and linking back to this thread?

Verdi March

unread,
Jun 22, 2015, 3:37:32 AM6/22/15
to julia...@googlegroups.com
Sure, it's been done.
Reply all
Reply to author
Forward
0 new messages