Skip to content

juliacall 0.9.33 import failure #771

@oyamad

Description

@oyamad

Affects: JuliaCall 0.9.33

Describe the bug

python -c "from juliacall import Main as jl" emits the following error:

ERROR: could not find project file (Project.toml or JuliaProject.toml) in package at `/Applications/anaconda3/envs/juliacalltest/lib/python3.14` maybe `subdir` needs to be specified
Full log
% python -c "from juliacall import Main as jl"
[juliapkg] Found dependencies: /Applications/anaconda3/envs/juliacalltest/lib/python3.14/site-packages/juliacall/juliapkg.json
[juliapkg] Found dependencies: /Applications/anaconda3/envs/juliacalltest/lib/python3.14/site-packages/juliapkg/juliapkg.json
[juliapkg] Locating Julia ^1.10.3
[juliapkg] Querying Julia versions from https://julialang-s3.julialang.org/bin/versions.json
[juliapkg] WARNING: About to install Julia 1.12.6 to /Applications/anaconda3/envs/juliacalltest/julia_env/pyjuliapkg/install.
[juliapkg]   If you use juliapkg in more than one environment, you are likely to
[juliapkg]   have Julia installed in multiple locations. It is recommended to
[juliapkg]   install JuliaUp (https://github.com/JuliaLang/juliaup) or Julia
[juliapkg]   (https://julialang.org/downloads) yourself.
[juliapkg] Downloading Julia from https://julialang-s3.julialang.org/bin/mac/aarch64/1.12/julia-1.12.6-macaarch64.dmg
             downloaded 47.2 MB of 221.5 MB
             downloaded 96.1 MB of 221.5 MB
             downloaded 135.0 MB of 221.5 MB
             downloaded 183.8 MB of 221.5 MB
             download complete
[juliapkg] Verifying download
[juliapkg] Installing Julia 1.12.6 to /Applications/anaconda3/envs/juliacalltest/julia_env/pyjuliapkg/install
[juliapkg] Using Julia 1.12.6 at /Applications/anaconda3/envs/juliacalltest/julia_env/pyjuliapkg/install/bin/julia
[juliapkg] Using Julia project at /Applications/anaconda3/envs/juliacalltest/julia_env
[juliapkg] Writing Project.toml:
           | [deps]
           | PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
           | OpenSSL_jll = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
           | 
           | [compat]
           | PythonCall = "=0.9.33"
           | OpenSSL_jll = "3.0.0 - 3.5"
[juliapkg] Installing packages:
           | import Pkg
           | Pkg.Registry.update()
           | Pkg.develop([
           |   Pkg.PackageSpec(name="PythonCall", uuid="6099a3de-0909-46bc-b1f4-468b9a2dfc0d", path=raw"/Applications/anaconda3/envs/juliacalltest/lib/python3.14"),
           | ])
           | Pkg.add([
           |   Pkg.PackageSpec(name="OpenSSL_jll", uuid="458c3c95-2e84-50aa-8efc-19380b2a3a95"),
           | ])
           | Pkg.resolve()
           | Pkg.precompile()
    Updating registry at `~/.julia/registries/General.toml`
ERROR: could not find project file (Project.toml or JuliaProject.toml) in package at `/Applications/anaconda3/envs/juliacalltest/lib/python3.14` maybe `subdir` needs to be specified
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types /Applications/anaconda3/envs/juliacalltest/julia_env/pyjuliapkg/install/share/julia/stdlib/v1.12/Pkg/src/Types.jl:68
  [2] resolve_projectfile!(pkg::Pkg.Types.PackageSpec, project_path::String)
    @ Pkg.Types /Applications/anaconda3/envs/juliacalltest/julia_env/pyjuliapkg/install/share/julia/stdlib/v1.12/Pkg/src/Types.jl:1072
  [3] handle_repo_develop!(ctx::Pkg.Types.Context, pkg::Pkg.Types.PackageSpec, shared::Bool)
    @ Pkg.Types /Applications/anaconda3/envs/juliacalltest/julia_env/pyjuliapkg/install/share/julia/stdlib/v1.12/Pkg/src/Types.jl:802
  [4] handle_repos_develop!(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, shared::Bool)
    @ Pkg.Types /Applications/anaconda3/envs/juliacalltest/julia_env/pyjuliapkg/install/share/julia/stdlib/v1.12/Pkg/src/Types.jl:892
  [5] develop(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; shared::Bool, preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::@Kwargs{io::IOContext{IO}})
    @ Pkg.API /Applications/anaconda3/envs/juliacalltest/julia_env/pyjuliapkg/install/share/julia/stdlib/v1.12/Pkg/src/API.jl:280
  [6] develop(pkgs::Vector{Pkg.Types.PackageSpec}; io::IOContext{IO}, kwargs::@Kwargs{})
    @ Pkg.API /Applications/anaconda3/envs/juliacalltest/julia_env/pyjuliapkg/install/share/julia/stdlib/v1.12/Pkg/src/API.jl:169
  [7] develop(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API /Applications/anaconda3/envs/juliacalltest/julia_env/pyjuliapkg/install/share/julia/stdlib/v1.12/Pkg/src/API.jl:158
  [8] top-level scope
    @ none:3
  [9] eval(m::Module, e::Any)
    @ Core ./boot.jl:489
 [10] exec_options(opts::Base.JLOptions)
    @ Base ./client.jl:283
 [11] _start()
    @ Base ./client.jl:550
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    from juliacall import Main as jl
  File "/Applications/anaconda3/envs/juliacalltest/lib/python3.14/site-packages/juliacall/__init__.py", line 330, in <module>
    init()
    ~~~~^^
  File "/Applications/anaconda3/envs/juliacalltest/lib/python3.14/site-packages/juliacall/__init__.py", line 200, in init
    CONFIG['exepath'] = juliapkg.executable()
                        ~~~~~~~~~~~~~~~~~~~^^
  File "/Applications/anaconda3/envs/juliacalltest/lib/python3.14/site-packages/juliapkg/deps.py", line 611, in executable
    resolve()
    ~~~~~~~^^
  File "/Applications/anaconda3/envs/juliacalltest/lib/python3.14/site-packages/juliapkg/deps.py", line 549, in resolve
    run_julia(script, executable=exe, project=project)
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Applications/anaconda3/envs/juliacalltest/lib/python3.14/site-packages/juliapkg/deps.py", line 597, in run_julia
    run(
    ~~~^
        [
        ^
    ...<7 lines>...
        env=env,
        ^^^^^^^^
    )
    ^
  File "/Applications/anaconda3/envs/juliacalltest/lib/python3.14/subprocess.py", line 578, in run
    raise CalledProcessError(retcode, process.args,
                             output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/Applications/anaconda3/envs/juliacalltest/julia_env/pyjuliapkg/install/bin/julia', '--project=/Applications/anaconda3/envs/juliacalltest/julia_env', '--startup-file=no', '-e', 'import Pkg\nPkg.Registry.update()\nPkg.develop([\n  Pkg.PackageSpec(name="PythonCall", uuid="6099a3de-0909-46bc-b1f4-468b9a2dfc0d", path=raw"/Applications/anaconda3/envs/juliacalltest/lib/python3.14"),\n])\nPkg.add([\n  Pkg.PackageSpec(name="OpenSSL_jll", uuid="458c3c95-2e84-50aa-8efc-19380b2a3a95"),\n])\nPkg.resolve()\nPkg.precompile()']' returned non-zero exit status 1.

This does not occur with 0.9.32.
ChatGPT says the following change in 58904d4#diff-285584010f9b06b0aff3fc0a8d32e15ae37174f6dc721aa9bd14c3de84ead9a2 is the suspect:

"path": "../..",
"dev": true

The following part in the full log

           | Pkg.develop([
           |   Pkg.PackageSpec(name="PythonCall", uuid="6099a3de-0909-46bc-b1f4-468b9a2dfc0d", path=raw"/Applications/anaconda3/envs/juliacalltest/lib/python3.14"),
           | ])

seems to try to develop PythonCall from lib/python3.14, which is not a Julia package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions