Skip to content

"from julia import xxx" requires "julia.call('using XXX')" #39

Closed

Description

@verdimrc

This issue has been discussed in Julia user groups (https://groups.google.com/d/msg/julia-users/oAWYShR1Pks/CYV8g2DyGeQJ).

Currently, importing Julia modules needs to be done this way:

1. import julia
2. j = julia.Julia()
3. j.call("using Clustering")
4. from julia import Clustering

Although not overly complicated, it would be convenient if the same could be achieved as:

1. import julia
2. from julia import Clustering

which is just like the original example by Jake Bolewski here.

Activity

  1. xiuliren commented on Feb 7, 2017

    @xiuliren

    neither of these two way worked for me.
    image

  2. xiuliren commented on Feb 7, 2017

    @xiuliren

    Just found that the new syntax is

    j.using("ModuleName")
    from julia import ModuleName
    
  3. rdeits commented on Jun 9, 2017

    @rdeits
    Contributor

    I'm not sure this is working with recent versions of pyjulia:

    In [1]: import julia; j = julia.Julia()
    
    In [2]: j.using("DataStructures")
    
    In [3]: from julia import DataStructures
    
    In [4]: DataStructures.OrderedDict()
    ---------------------------------------------------------------------------
    TypeError                                 Traceback (most recent call last)
    <ipython-input-4-5350ee7830c7> in <module>()
    ----> 1 DataStructures.OrderedDict()
    
    TypeError: 'PyCall.jlwrap' object is not callable
    

    (pyjulia master with Julia v0.5.2)

  4. added 3 commits that reference this issue on May 16, 2018
    c643c53
    edaec63
    51997c0
  5. added a commit that references this issue on Jun 20, 2018
    8d52803
  6. added a commit that references this issue on Jul 31, 2018
    f87429a
  7. added a commit that references this issue on Dec 28, 2024
    e617ad9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions