tensor4all / T4AJuliaTutorials

http://tensor4all.org/T4AJuliaTutorials/
3 stars 0 forks source link

Error while building the Jupiter Book #34

Open simone-fdr opened 1 week ago

simone-fdr commented 1 week ago

I am on an Alma Linux machine and after doing

$ cd path/to/my/workspace/directory
$ git clone https://github.com/tensor4all/T4AJuliaTutorials.git
$ cd T4AJuliaTutorials

I simply run

$ make

And I get the following error

julia --project scripts/setup.jl
       Added `General` registry to ~/.julia/registries
┌ Warning: The project dependencies or compat requirements have changed since the manifest was last resolved.
│ It is recommended to `Pkg.resolve()` or consider `Pkg.update()` if necessary.
└ @ Pkg.API ~/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/API.jl:1848
    Building Conda ─→ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/b19db3927f0db4151cb86d073689f2428e524576/build.log`
    Building IJulia → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/1702f79fa30f56b68d5b2fd6fb3a9a14ff6f9130/build.log`
┌ Warning: The project dependencies or compat requirements have changed since the manifest was last resolved.
│ It is recommended to `Pkg.resolve()` or consider `Pkg.update()` if necessary.
└ @ Pkg.API ~/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/API.jl:1848
julia --project scripts/jupytext.jl compress.jl index.jl interfacingwithitensors.jl pythonplot.jl qft.jl quantics1d_advanced.jl quantics1d.jl quantics2d.jl
    CondaPkg Found dependencies: /home/s/Simone.Fodera/Projects/T4AJuliaTutorials/CondaPkg.toml
    CondaPkg Found dependencies: /home/s/Simone.Fodera/.julia/packages/PythonCall/S5MOg/CondaPkg.toml
    CondaPkg Found dependencies: /home/s/Simone.Fodera/.julia/packages/PythonPlot/f591M/CondaPkg.toml
    CondaPkg Found dependencies: /home/s/Simone.Fodera/.julia/packages/PythonPlot/469aA/CondaPkg.toml
    CondaPkg Found dependencies: /home/s/Simone.Fodera/.julia/packages/PythonCall/Nr75f/CondaPkg.toml
    CondaPkg Resolving changes
             + jupyter-book
             + jupytext
             + libstdcxx-ng
             + matplotlib
             + openssl
             + python
    CondaPkg Creating environment
             │ /home/s/Simone.Fodera/.julia/artifacts/7973f2c7725e2d0eef7a95159454c4145f0945a2/bin/micromamba
             │ -r /home/s/Simone.Fodera/.julia/scratchspaces/0b3b1443-0f03-428d-bdfb-f27f9c1191ea/root
             │ create
             │ -y
             │ -p /home/s/Simone.Fodera/Projects/T4AJuliaTutorials/.CondaPkg/env
             │ --override-channels
             │ --no-channel-priority
             │ jupyter-book[version='*']
             │ jupytext[version='>=1.16']
             │ libstdcxx-ng[version='>=3.4,<13.0']
             │ matplotlib[version='>=3.8,<3.9']
             │ matplotlib[version='>=1']
             │ openssl[version='<=julia']
             │ python[version='>=3.11,<3.12']
             │ python[version='>=3.8,<4',channel='conda-forge',build='*cpython*']
             └ -c conda-forge
conda-forge/linux-64                                        Using cache
conda-forge/noarch                                          Using cache
error    libmamba Could not solve for environment specs
    The following package could not be installed
    └─ openssl <=julia  does not exist (perhaps a typo or a missing channel).
critical libmamba Could not solve for environment specs
ERROR: LoadError: InitError: failed process: Process(`/home/s/Simone.Fodera/.julia/artifacts/7973f2c7725e2d0eef7a95159454c4145f0945a2/bin/micromamba -r /home/s/Simone.Fodera/.julia/scratchspaces/0b3b1443-0f03-428d-bdfb-f27f9c1191ea/root create -y -p /home/s/Simone.Fodera/Projects/T4AJuliaTutorials/.CondaPkg/env --override-channels --no-channel-priority "jupyter-book[version='*']" "jupytext[version='>=1.16']" "libstdcxx-ng[version='>=3.4,<13.0']" "matplotlib[version='>=3.8,<3.9']" "matplotlib[version='>=1']" "openssl[version='<=julia']" "python[version='>=3.11,<3.12']" "python[version='>=3.8,<4',channel='conda-forge',build='*cpython*']" -c conda-forge`, ProcessExited(1)) [1]

Stacktrace:
  [1] pipeline_error
    @ ./process.jl:565 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base ./process.jl:480
  [3] run(::Cmd)
    @ Base ./process.jl:477
  [4] _run(io::IO, cmd::Cmd, args::Any; flags::Any)
    @ CondaPkg ~/.julia/packages/CondaPkg/MmzxM/src/resolve.jl:398
  [5] _resolve_conda_install(io::Any, conda_env::Any, specs::Any, channels::Any; create::Any)
    @ CondaPkg ~/.julia/packages/CondaPkg/MmzxM/src/resolve.jl:299
  [6] resolve(; force::Bool, io::IO, interactive::Bool, dry_run::Bool)
    @ CondaPkg ~/.julia/packages/CondaPkg/MmzxM/src/resolve.jl:547
  [7] resolve()
    @ CondaPkg ~/.julia/packages/CondaPkg/MmzxM/src/resolve.jl:405
  [8] envdir()
    @ CondaPkg ~/.julia/packages/CondaPkg/MmzxM/src/env.jl:70
  [9] init_context()
    @ PythonCall.C ~/.julia/packages/PythonCall/S5MOg/src/C/context.jl:63
 [10] __init__()
    @ PythonCall.C ~/.julia/packages/PythonCall/S5MOg/src/C/C.jl:23
 [11] run_module_init(mod::Module, i::Int64)
    @ Base ./loading.jl:1134
 [12] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1122
 [13] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base ./loading.jl:1067
 [14] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base ./loading.jl:1581
 [15] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1938
 [16] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1812
 [17] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [18] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [19] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1803
 [20] macro expansion
    @ ./loading.jl:1790 [inlined]
 [21] macro expansion
    @ ./lock.jl:267 [inlined]
 [22] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1753
 [23] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [24] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [25] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1746
during initialization of module C
in expression starting at /home/s/Simone.Fodera/Projects/T4AJuliaTutorials/scripts/jupytext.jl:1
make: *** [Makefile:3: ipynbs/*.ipynb] Error 1

I get a very similar error using the Julia VS Code extension while running an .ipynb file.

How can I proceed to resolve this error or workaround it?

shinaoka commented 1 week ago

We are sorry for the inconvenience. On my MacBook (Sonoma), I got a similar error

error    libmamba Could not solve for environment specs
    The following packages are incompatible
    ├─ openssl >=1.1,<1.1.24  is requested and can be installed;
    └─ openssl >=3,<3.1  is not installable because it conflicts with any installable versions previously reported.
critical libmamba Could not solve for environment specs
ERROR: LoadError: InitError: failed process: Process(`/Users/hiroshi/.julia/artifacts/98aba21a6802e06a5d2e7c48633d7dc1c3d4a749/bin/micromamba -r /Users/hiroshi/.julia/scratchspaces/0b3b1443-0f03-428d-bdfb-f27f9c1191ea/root install -y -p /Users/hiroshi/git/T4AJuliaTutorials/.CondaPkg/env --override-channels --no-channel-priority "jupyter-book[version='*']" "jupytext[version='>=1.16']" "matplotlib[version='>=1']" "openssl[version='>=3, <3.1']" "openssl[version='>=1.1, <1.1.24']" "python[version='>=3.8,<4',channel='conda-forge',build='*cpython*']" "python[version='>=3.11,<3.12']" -c conda-forge`, ProcessExited(1)) [1]

This dependence on conda, which is required for plotting using PythonPlot.jl, is very annoying. We are now removing the dependence by switching to pure Julia plotting libraries.

terasakisatoshi commented 1 week ago

Could you try the following commands?

$ make clean
$ rm Manifest.toml
$ make
terasakisatoshi commented 1 week ago

On GitHub Action, we could see the expected result:

https://github.com/tensor4all/T4AJuliaTutorials/actions/runs/10711417889/job/29700077099#step:8:284

terasakisatoshi commented 1 week ago

https://github.com/tensor4all/T4AJuliaTutorials/pull/35 is merged on main. Could you do git pull and build book again?

shinaoka commented 1 week ago

@terasakisatoshi Thank you for the update. I still face the same problem....

hiroshi@MBA15 T4AJuliaTutorials % make
julia --project scripts/setup.jl
       Added `General` registry to ~/.julia/registries
    Building Conda ─→ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/b19db3927f0db4151cb86d073689f2428e524576/build.log`
    Building IJulia → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/1702f79fa30f56b68d5b2fd6fb3a9a14ff6f9130/build.log`
julia --project scripts/jupytext.jl compress.jl index.jl interfacingwithitensors.jl plots.jl qft.jl quantics1d.jl quantics1d_advanced.jl quantics2d.jl
    CondaPkg Found dependencies: /Users/hiroshi/Downloads/T4AJuliaTutorials/CondaPkg.toml
    CondaPkg Found dependencies: /Users/hiroshi/.julia/packages/PythonCall/Nr75f/CondaPkg.toml
    CondaPkg Found dependencies: /Users/hiroshi/.julia/packages/PythonCall/flx5V/CondaPkg.toml
    CondaPkg Found dependencies: /Users/hiroshi/.julia/packages/PythonPlot/469aA/CondaPkg.toml
    CondaPkg Resolving changes
             + jupyter-book
             + jupytext
             + matplotlib
             + openssl
             + python
    CondaPkg Creating environment
             │ /Users/hiroshi/.julia/artifacts/98aba21a6802e06a5d2e7c48633d7dc1c3d4a749/bin/micromamba
             │ -r /Users/hiroshi/.julia/scratchspaces/0b3b1443-0f03-428d-bdfb-f27f9c1191ea/root
             │ create
             │ -y
             │ -p /Users/hiroshi/Downloads/T4AJuliaTutorials/.CondaPkg/env
             │ --override-channels
             │ --no-channel-priority
             │ jupyter-book[version='*']
             │ jupytext[version='>=1.16']
             │ matplotlib[version='>=1']
             │ openssl[version='>=3, <3.1']
             │ openssl[version='>=1.1, <1.1.24']
             │ python[version='>=3.8,<4',channel='conda-forge',build='*cpython*']
             │ python[version='>=3.11,<3.12']
             └ -c conda-forge
conda-forge/osx-arm64                                       Using cache
conda-forge/noarch                                          Using cache
error    libmamba Could not solve for environment specs
    The following packages are incompatible
    ├─ openssl >=1.1,<1.1.24  is requested and can be installed;
    └─ openssl >=3,<3.1  is not installable because it conflicts with any installable versions previously reported.
critical libmamba Could not solve for environment specs
ERROR: LoadError: InitError: failed process: Process(`/Users/hiroshi/.julia/artifacts/98aba21a6802e06a5d2e7c48633d7dc1c3d4a749/bin/micromamba -r /Users/hiroshi/.julia/scratchspaces/0b3b1443-0f03-428d-bdfb-f27f9c1191ea/root create -y -p /Users/hiroshi/Downloads/T4AJuliaTutorials/.CondaPkg/env --override-channels --no-channel-priority "jupyter-book[version='*']" "jupytext[version='>=1.16']" "matplotlib[version='>=1']" "openssl[version='>=3, <3.1']" "openssl[version='>=1.1, <1.1.24']" "python[version='>=3.8,<4',channel='conda-forge',build='*cpython*']" "python[version='>=3.11,<3.12']" -c conda-forge`, ProcessExited(1)) [1]
terasakisatoshi commented 1 week ago

@shinaoka @simone-fdr

Could you show me the versions of CondaPkg and PythonCall?

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.5 (2024-08-27)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(T4AJuliaTutorials) pkg> st
Status `~/work/atelierarith/tensor4all/T4AJuliaTutorials/Project.toml`
  [992eb4ea] CondaPkg v0.2.23
  [7073ff75] IJulia v1.25.0
  [9136182c] ITensors v0.6.17
  [b964fa9f] LaTeXStrings v1.3.1
  [16fef848] LiveServer v1.3.1
  [91a5bcdd] Plots v1.40.8
  [6099a3de] PythonCall v0.9.23
  [87f76fb3] Quantics v0.3.8
  [634c7f73] QuanticsGrids v0.3.2
  [b11687fd] QuanticsTCI v0.7.0
  [9f0aa9f4] TCIITensorConversion v0.1.4
  [b261b2ec] TensorCrossInterpolation v0.9.12
  [de0858da] Printf
terasakisatoshi commented 1 week ago

@shinaoka

Make sure you have switched to the latest main branch. On the main branch, CondaPkg.toml does NOT require matplotlib', while your terminal output containsmatplotlib'.

https://github.com/tensor4all/T4AJuliaTutorials/blob/193a34b0c8b435aec06ad58e50eb16acba6386ee/CondaPkg.toml#L1-L6

Before running make command, you may want to remove .CondaPkg directory manually.

shinaoka commented 1 week ago

I cloned the repository from the scratch (main branch).

shinaoka commented 1 week ago

A workaround could be the following.

  1. Download all notebooks from here.

  2. Unzip the zip file.

  3. Launch a jupyter server from a Julia REPL:

cd ipynbs
Julia
julia> using Pkg;Pkg.activate(".");Pkg.instantiate();
  Activating project at `XXXX/ipynbs`
julia> using IJulia; IJulia.notebook()
terasakisatoshi commented 1 week ago

A workaround could be the following.

  1. Download all notebooks from here.
  2. Unzip the zip file.
  3. Launch a jupyter server from a Julia REPL:
cd ipynbs
Julia
julia> using Pkg;Pkg.activate(".");Pkg.instantiate();
  Activating project at `XXXX/ipynbs`
julia> using IJulia; IJulia.notebook()

I've created https://github.com/tensor4all/T4AJuliaTutorials/wiki/How-to-preview-pre%E2%80%90built-jupyter-notebooks-locally-in-VS-Code

shinaoka commented 1 week ago

There seems to be some dependence on PythonPlot.jl. It is weird.

(T4AJuliaTutorials) pkg> st
Status `~/git/T4AJuliaTutorials/Project.toml`
  [992eb4ea] CondaPkg v0.2.23
  [7073ff75] IJulia v1.25.0
  [9136182c] ITensors v0.6.17
  [b964fa9f] LaTeXStrings v1.3.1
  [16fef848] LiveServer v1.3.1
  [91a5bcdd] Plots v1.40.8
  [6099a3de] PythonCall v0.9.23
  [87f76fb3] Quantics v0.3.8
  [634c7f73] QuanticsGrids v0.3.2
  [b11687fd] QuanticsTCI v0.7.0
  [9f0aa9f4] TCIITensorConversion v0.1.4
  [b261b2ec] TensorCrossInterpolation v0.9.12
  [de0858da] Printf
hiroshi@MBA15 T4AJuliaTutorials % make
julia --project scripts/setup.jl
       Added `General` registry to ~/.julia/registries
    Building Conda ─→ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/b19db3927f0db4151cb86d073689f2428e524576/build.log`
    Building IJulia → `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/1702f79fa30f56b68d5b2fd6fb3a9a14ff6f9130/build.log`
julia --project scripts/jupytext.jl compress.jl
    CondaPkg Found dependencies: /Users/hiroshi/.julia/packages/PythonCall/Nr75f/CondaPkg.toml
    CondaPkg Found dependencies: /Users/hiroshi/.julia/packages/PythonCall/flx5V/CondaPkg.toml
    CondaPkg Found dependencies: /Users/hiroshi/.julia/packages/PythonPlot/469aA/CondaPkg.toml
    CondaPkg Resolving changes
             + matplotlib
             + openssl
             + python
    CondaPkg Creating environment
             │ /Users/hiroshi/.julia/artifacts/98aba21a6802e06a5d2e7c48633d7dc1c3d4a749/bin/micromamba
             │ -r /Users/hiroshi/.julia/scratchspaces/0b3b1443-0f03-428d-bdfb-f27f9c1191ea/root
             │ create
             │ -y
terasakisatoshi commented 1 week ago

Could you remove the following paths manually e.g., rm -r ... and try again?

/Users/hiroshi/.julia/packages/PythonCall
/Users/hiroshi/.julia/packages/PythonPlot
/Users/hiroshi/.julia/artifacts
/Users/hiroshi/.julia/scratchspaces
terasakisatoshi commented 1 week ago

Here is what I did:

Open a terminal with zsh

yes | rm -rf ~/.julia
yes | rm -rf ~/.juliaup
curl -fsSL https://install.julialang.org | sh -s -- --yes
source ~/.zshrc
git clone https://github.com/tensor4all/T4AJuliaTutorials.git
cd T4AJuliaTutorials
make

This works on my Intel macOS and M2 macOS