Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build book on mac when folder name is not project name. #2150

Open
GJBoth opened this issue May 13, 2024 · 1 comment
Open

Can't build book on mac when folder name is not project name. #2150

GJBoth opened this issue May 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@GJBoth
Copy link

GJBoth commented May 13, 2024

Describe the bug

I have a repository whose folder name is different than the package name. When building the book it fails because the virtual environment name is wrong (see below).

Reproduce the bug

Have a repo with a different folder name than the package, and the build will fail. Changing the folder name to match the package, and the build succeeds. The bug only manifests on mac, on linux it works as expected.

List your environment

# Platform:         darwin; (macOS-14.1-arm64-arm-64bit)
# Sphinx version:   7.3.7
# Python version:   3.11.9 (CPython)
# Docutils version: 0.20.1
# Jinja2 version:   3.1.3
# Pygments version: 2.18.0

# Last messages:
#   
#   
#   reading sources... [ 50%]
#   markdown
#   
#   
#   reading sources... [ 75%]
#   markdown-notebooks
#   
#   /Users/bothg/Documents/flybody/flybody_internal/docs/markdown-notebooks.md: Executing notebook using local CWD [mystnb]

# Loaded extensions:
#   sphinx.ext.mathjax (7.3.7)
#   alabaster (0.7.16)
#   sphinxcontrib.applehelp (1.0.8)
#   sphinxcontrib.devhelp (1.0.6)
#   sphinxcontrib.htmlhelp (2.0.5)
#   sphinxcontrib.serializinghtml (1.1.10)
#   sphinxcontrib.qthelp (1.0.7)
#   sphinx_togglebutton (0.3.2)
#   sphinx_copybutton (0.5.2)
#   myst_nb (1.1.0)
#   jupyter_book (1.0.0)
#   sphinx_thebe (0.3.1)
#   sphinx_comments (0.0.3)
#   sphinx_external_toc (1.0.1)
#   sphinx.ext.intersphinx (7.3.7)
#   sphinx_design (0.5.0)
#   sphinx_book_theme (unknown version)
#   sphinxcontrib.bibtex (2.6.2)
#   sphinx_jupyterbook_latex (unknown version)
#   sphinx_multitoc_numbering (unknown version)
#   pydata_sphinx_theme (unknown version)

# Traceback:
Traceback (most recent call last):
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/jupyter_book/sphinx.py", line 167, in build_sphinx
    app.build(force_all, filenames)
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/sphinx/application.py", line 351, in build
    self.builder.build_update()
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/sphinx/builders/__init__.py", line 293, in build_update
    self.build(to_build,
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/sphinx/builders/__init__.py", line 313, in build
    updated_docnames = set(self.read())
                           ^^^^^^^^^^^
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/sphinx/builders/__init__.py", line 419, in read
    self._read_serial(docnames)
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/sphinx/builders/__init__.py", line 440, in _read_serial
    self.read_doc(docname)
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/sphinx/builders/__init__.py", line 497, in read_doc
    publisher.publish()
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/docutils/core.py", line 234, in publish
    self.document = self.reader.read(self.source, self.parser,
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/sphinx/io.py", line 107, in read
    self.parse()
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/docutils/readers/__init__.py", line 76, in parse
    self.parser.parse(self.input, document)
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/myst_nb/sphinx_.py", line 152, in parse
    with create_client(
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/myst_nb/core/execute/base.py", line 79, in __enter__
    self.start_client()
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/myst_nb/core/execute/direct.py", line 40, in start_client
    result = single_nb_execution(
             ^^^^^^^^^^^^^^^^^^^^
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/jupyter_cache/executors/utils.py", line 58, in single_nb_execution
    executenb(
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/nbclient/client.py", line 1314, in execute
    return NotebookClient(nb=nb, resources=resources, km=km, **kwargs).execute()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/jupyter_core/utils/__init__.py", line 165, in wrapped
    return loop.run_until_complete(inner)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/nbclient/client.py", line 693, in async_execute
    async with self.async_setup_kernel(**kwargs):
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/nbclient/client.py", line 648, in async_setup_kernel
    await self.async_start_new_kernel(**kwargs)
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/nbclient/client.py", line 550, in async_start_new_kernel
    await ensure_async(self.km.start_kernel(extra_arguments=self.extra_arguments, **kwargs))
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/jupyter_core/utils/__init__.py", line 198, in ensure_async
    result = await obj
             ^^^^^^^^^
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/jupyter_client/manager.py", line 96, in wrapper
    raise e
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/jupyter_client/manager.py", line 87, in wrapper
    out = await method(self, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/jupyter_client/manager.py", line 439, in _async_start_kernel
    await self._async_launch_kernel(kernel_cmd, **kw)
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/jupyter_client/manager.py", line 354, in _async_launch_kernel
    connection_info = await self.provisioner.launch_kernel(kernel_cmd, **kw)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/jupyter_client/provisioning/local_provisioner.py", line 210, in launch_kernel
    self.process = launch_kernel(cmd, **scrubbed_kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/jupyter_client/launcher.py", line 170, in launch_kernel
    raise ex
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/site-packages/jupyter_client/launcher.py", line 155, in launch_kernel
    proc = Popen(cmd, **kwargs)  # noqa
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Users/bothg/.pyenv/versions/3.11.9/lib/python3.11/subprocess.py", line 1955, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/bothg/Documents/flybody/flybody/.venv/bin/python'
@GJBoth GJBoth added the bug Something isn't working label May 13, 2024
Copy link

welcome bot commented May 13, 2024

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant