Skip to content

Failing Deploy to GitHub Pages due to ModuleNotFoundError #1198

@chiaraf10

Description

@chiaraf10

Hello,

In my repo, I am using Pygem library ( https://mathlab.github.io/PyGeM/ ). Of this library there is no release in pip or conda. I am able to run it locally since I have followed the installation by running python setup.py install. I have cloned the repo and I am storing it inside the nbs folder so that I can call the script from the notebooks.
My problem begins when I am pushing my notebooks to Github and the Deploy pages action fails due to error: "ModuleNotFoundError: No module named 'pygem'".

any help on how I would fix this?

Here is the traceback:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 3433, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-1-68dd88ca3b53>", line 1, in <module>
    from pygem.rbf import RBF
ModuleNotFoundError: No module named 'pygem'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/concurrent/futures/process.py", line 246, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/concurrent/futures/process.py", line 205, in _process_chunk
    return [fn(*args) for args in chunk]
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/concurrent/futures/process.py", line 205, in <listcomp>
    return [fn(*args) for args in chunk]
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/fastcore/parallel.py", line 46, in _call
    return g(item)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbdev/serve_drv.py", line 22, in main
    if src.suffix=='.ipynb': exec_nb(src, dst, x)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbdev/serve_drv.py", line 16, in exec_nb
    cb()(nb)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbdev/processors.py", line 231, in __call__
    def __call__(self, nb): return self.nb_proc(nb).process()
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbdev/process.py", line 126, in process
    for proc in self.procs: self._proc(proc)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbdev/process.py", line 119, in _proc
    for cell in self.nb.cells: self._process_cell(proc, cell)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbdev/process.py", line 110, in _process_cell
    if callable(proc) and not _is_direc(proc): cell = opt_set(cell, proc(cell))
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbdev/processors.py", line 201, in __call__
    raise Exception(f"Error{' in notebook: '+title if title else ''} in cell {cell.idx_} :\n{cell.source}") from self.k.exc[1]
Exception: Error in notebook: Morphing. in cell 6 :
from pygem.rbf import RBF
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.8/x64/bin/nbdev_docs", line 8, in <module>
    sys.exit(nbdev_docs())
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/fastcore/script.py", line 119, in _f
    return tfunc(**merge(args, args_from_prog(func, xtra)))
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbdev/quarto.py", line 226, in nbdev_docs
    cache,cfg,path = _pre_docs(path, n_workers=n_workers, **kwargs)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbdev/quarto.py", line 174, in _pre_docs
    cache = proc_nbs(path, n_workers=n_workers, **kwargs)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbdev/serve.py", line 76, in proc_nbs
    parallel(nbdev.serve_drv.main, files, n_workers=n_workers, pause=0.01, **kw)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/fastcore/parallel.py", line 117, in parallel
    return L(r)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/fastcore/foundation.py", line 98, in __call__
    return super().__call__(x, *args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/fastcore/foundation.py", line 106, in __init__
    items = listify(items, *rest, use_list=use_list, match=match)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/fastcore/basics.py", line 66, in listify
    elif is_iter(o): res = list(o)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/concurrent/futures/process.py", line 570, in _chain_from_iterable_of_lists
    for element in iterable:
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/concurrent/futures/_base.py", line 621, in result_iterator
    yield _result_or_cancel(fs.pop())
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/concurrent/futures/_base.py", line 319, in _result_or_cancel
    return fut.result(timeout)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/concurrent/futures/_base.py", line 458, in result
    return self.__get_result()
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/concurrent/futures/_base.py", line [403](https://github.com/chiaraf10/SSMT/actions/runs/3370141521/jobs/5590669074#step:2:414), in __get_result
    raise self._exception
Exception: Error in notebook: Morphing. in cell 6 :
from pygem.rbf import RBF
Error: Process completed with exit code 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/concurrent/futures/process.py", line 246, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/concurrent/futures/process.py", line 205, in _process_chunk
    return [fn(*args) for args in chunk]
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/concurrent/futures/process.py", line 205, in <listcomp>
    return [fn(*args) for args in chunk]
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/fastcore/parallel.py", line 46, in _call
    return g(item)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbdev/serve_drv.py", line 22, in main
    if src.suffix=='.ipynb': exec_nb(src, dst, x)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbdev/serve_drv.py", line 16, in exec_nb
    cb()(nb)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbdev/processors.py", line 231, in __call__
    def __call__(self, nb): return self.nb_proc(nb).process()
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbdev/process.py", line 126, in process
    for proc in self.procs: self._proc(proc)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbdev/process.py", line 119, in _proc
    for cell in self.nb.cells: self._process_cell(proc, cell)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbdev/process.py", line 110, in _process_cell
    if callable(proc) and not _is_direc(proc): cell = opt_set(cell, proc(cell))
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbdev/processors.py", line 201, in __call__
    raise Exception(f"Error{' in notebook: '+title if title else ''} in cell {cell.idx_} :\n{cell.source}") from self.k.exc[1]
Exception: Error in notebook: Morphing. in cell 6 :
from pygem.rbf import RBF
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.8/x64/bin/nbdev_docs", line 8, in <module>
    sys.exit(nbdev_docs())
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/fastcore/script.py", line 119, in _f
    return tfunc(**merge(args, args_from_prog(func, xtra)))
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbdev/quarto.py", line 226, in nbdev_docs
    cache,cfg,path = _pre_docs(path, n_workers=n_workers, **kwargs)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbdev/quarto.py", line 174, in _pre_docs
    cache = proc_nbs(path, n_workers=n_workers, **kwargs)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/nbdev/serve.py", line 76, in proc_nbs
    parallel(nbdev.serve_drv.main, files, n_workers=n_workers, pause=0.01, **kw)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/fastcore/parallel.py", line 117, in parallel
    return L(r)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/fastcore/foundation.py", line 98, in __call__
    return super().__call__(x, *args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/fastcore/foundation.py", line 106, in __init__
    items = listify(items, *rest, use_list=use_list, match=match)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/site-packages/fastcore/basics.py", line 66, in listify
    elif is_iter(o): res = list(o)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/concurrent/futures/process.py", line 570, in _chain_from_iterable_of_lists
    for element in iterable:
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/concurrent/futures/_base.py", line 621, in result_iterator
    yield _result_or_cancel(fs.pop())
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/concurrent/futures/_base.py", line 319, in _result_or_cancel
    return fut.result(timeout)
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/concurrent/futures/_base.py", line 458, in result
    return self.__get_result()
  File "/opt/hostedtoolcache/Python/3.10.8/x64/lib/python3.10/concurrent/futures/_base.py", line [403](https://github.com/chiaraf10/SSMT/actions/runs/3370141521/jobs/5590669074#step:2:414), in __get_result
    raise self._exception
Exception: Error in notebook: Morphing. in cell 6 :
from pygem.rbf import RBF
Error: Process completed with exit code 1.

PS. I cannot share the repo, as I am storing some private data.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions