Installing pyjulia

未关闭
#473 8 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
28/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
julia, python
领域
tooling

调研方向

首先定位 setup.py,并检查 issue 中展示的 julia.install() 和 LibJulia 入口点,同时将链接的 juliacall 示例作为行为参考。当用户可以调用建议的 setup_pyjulia_env 流程来安装所需的 Julia 依赖项,并可选择实例化请求的项目环境时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

Here is a little function that downloads julia if needed, set up an environmnt and instantiate the project.

I think something similar should be provided so that users can call it in setup.py

def setup_pyjulia_env(path_to_project="."):
    """
    A function that installs all dependencies for current environment.
    This should be the same as what `juliacall` does at every import time.
    * `path_to_project` is the path to the project that will be instantiated.
    If `None`, no project will be instantiated. Defaults: to the current
    working directory.
    """
    import jill.install  # noqa: autoimport
    import os  # noqa: autoimport
    import shutil  # noqa: autoimport
    if shutil.which('julia') is None:
        print(
            "No Julia executable found, installing the latest version using `jill`")
        jill.install.install_julia("stable", confirm=True)
        if shutil.which('julia') is None:
            print(f"Please add {os.environ['JILL_SYMLINK_DIR']} to your path")
    import julia  # noqa: autoimport
    # the following installs dependencies for pyjulia
    julia.install()
    from julia.api import LibJulia  # noqa: autoimport

    if path_to_project is not None:
        api = LibJulia.load()
        api.init_julia([f"--project={path_to_project}"])

        from julia import Main  # noqa: autoimport

        Main.eval('using Pkg')
        Main.eval('Pkg.instantiate()')

Example from: https://github.com/00sapo/pyjulia-vs-juliacall

主要语言
Python
星标
893
派生
101
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

JuliaPy/pyjulia 的其他 Issue

查看 JuliaPy/pyjulia 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。