8LWXpg / jupyter2typst

Jupyter to Typst converter with template support
MIT License
11 stars 0 forks source link

not working on linux #1

Closed Eloitor closed 8 months ago

Eloitor commented 8 months ago

Description

Hi, I compiled and run from linux.

$ jupyter2typst Untitled.ipynb             
thread 'main' panicked at src/main.rs:56:10:
Failed to set current directory: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
$ RUST_BACKTRACE=full jupyter2typst Untitled.ipynb           
thread 'main' panicked at src/main.rs:56:10:
Failed to set current directory: Os { code: 2, kind: NotFound, message: "No such file or directory" }
stack backtrace:
   0:     0x559721673f0c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hc3b88a0ed6c5afbf
   1:     0x55972169c85b - core::fmt::write::hf0030323ef2de926
   2:     0x559721670a3e - std::io::Write::write_fmt::h69911cb4c8790a1f
   3:     0x559721673cf5 - std::sys_common::backtrace::print::he441f447f0231532
   4:     0x559721675374 - std::panicking::default_hook::{{closure}}::hbd5dbffb1b120121
   5:     0x559721675093 - std::panicking::default_hook::h35452db54148727c
   6:     0x55972167591f - std::panicking::rust_panic_with_hook::h37faa341ad29f7fd
   7:     0x559721675811 - std::panicking::begin_panic_handler::{{closure}}::h02e511cdf7bc65a2
   8:     0x559721674436 - std::sys_common::backtrace::__rust_end_short_backtrace::h978128bcc3d8fca0
   9:     0x559721675532 - rust_begin_unwind
  10:     0x5597213a2ac5 - core::panicking::panic_fmt::hef80f46d93299868
  11:     0x5597213a2fa3 - core::result::unwrap_failed::hab2c6de8243ff0ae
  12:     0x5597213d46ec - jupyter2typst::main::h7e8ff21362099c42
  13:     0x5597213d99e3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h1234355e722716e6
  14:     0x5597213d7a29 - std::rt::lang_start::{{closure}}::h950f2dced26dd6f5
  15:     0x55972166c638 - std::rt::lang_start_internal::h96d2d059d51f9fde
  16:     0x5597213d4f55 - main
  17:     0x7fc18096118c - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  18:     0x7fc180961245 - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:381:3
  19:     0x5597213a32a1 - _start
                               at /builddir/glibc-2.36/csu/../sysdeps/x86_64/start.S:115
  20:                0x0 - <unknown>
Eloitor commented 8 months ago
$ cat Untitled.ipynb
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "2057c114-98c0-4007-a701-4193d750f3df",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "1+1"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
8LWXpg commented 8 months ago

does it works with

jupyter2typst ./Untitled.ipynb
Eloitor commented 8 months ago

Yes it works! thanks

Eloitor commented 8 months ago

Maybe you could improve the error message :)

Great project!

8LWXpg commented 8 months ago

I'll make a quick fix if filename doesn't contains ./