pytorch / pytorch/tutorials

[BUG] Running `make html-noplot` yields errors.

Open
#3,373 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug build issue
Dominant language
Python
Stars
9.3k
Forks
4.4k
Avg merge
1d 21h
Merged PRs (30d)
4

Description

Add Link

I ran the following command about 10 hours ago, around 12:20:00 utc and it gave me errors. (I am being specific about the time, because I was unable to find a release that I could point to).
git clone --depth 1 https://github.com/pytorch/tutorials.git

Describe the bug

What errors did you encounter?

generating gallery for beginner... [  6%] saving_loading_models.py
Extension error (sphinx_gallery.gen_gallery):
Handler <function generate_gallery_rst at 0x000001C0A8C3AB00> for event 'builder-inited' threw an exception (exception: Can't pickle <function call_fn at 0x000001C088543010>: attribute lookup call_fn on __main__ failed)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python\Python310\lib\multiprocessing\spawn.py", line 107, in spawn_main
    new_handle = reduction.duplicate(pipe_handle,
  File "C:\Python\Python310\lib\multiprocessing\reduction.py", line 79, in duplicate
    return _winapi.DuplicateHandle(
OSError: [WinError 6] The handle is invalid
make: *** [html-noplot] Error 2

What did you expect to happen?

As stated in the README.md file, I expected a basic html version of the tutorial to be built at _build/html

Steps to Reproduce the error

  1. Run the git command below
    git clone --depth 1 https://github.com/pytorch/tutorials.git

  2. Run pip install -r .ci/docker/requirements.txt. I am aware the instruction was to pip install -r requirements.txt. But
    I keep encountering the errors below, so I improvised.

ERROR: Invalid requirement: '.ci/docker/requirements.txt': Expected package name at the start of dependency specifier
    .ci/docker/requirements.txt
    ^ (from line 1 of requirements.txt)
  1. Run make html-noplot. For this one, I gnuWin32 make. This is what is available on Windows.

    I noticed that this error is similar to that found when I run re.compile('\c'). I am familiar with this scenario and so I looked further and traced the error to the code here. I was able to move on from this error by modifying my local version of the code to
    SPHINX_SHOULD_RUN = "|".join(get_files_for_sphinx()).replace('\\', '\\\\')
    I want to note that I do not feel confident in that action because I notice that code was last modified 2 years ago, unless I have a wrong interpretation of what the "2 years ago" that I see around there means. It was last modified 2 years ago! That means that working tutorials have been built with that piece of code. This makes me feel very strongly that something is wrong with my setup. But I resisted raising any issues because I considered that it might not be worth it to distract the attention of our dear conscientious developers whose efforts to maintain this codebase does not go unnoticed.

  2. Run make html-noplot once more.
    The error above appears. I look at the error and I see multiprocessing.py there. I do not know how to do anything with code that runs on more than one thread or process. I would appreciate knowing what I have done wrong in my environment because surely the code in this repository works as it has been tested as required.

Describe your environment

Environment

  • Python 3.10.5
  • pip 25.1.1
  • All commands were run in the top directory of the cloned repository
  • All pip-installing was done in a fresh virtual environment created using venv and located in the top directory of the cloned repository. The command used for that was python -m venv doc-env.
  • GPU (not cuda): Intel Iris Xe (Not sure this is relevant)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the make html-noplot entry point and .jenkins/get_sphinx_filenames.py, then reproduce the documented build in the stated Windows, Python 3.10, and virtualenv environment. Check the requirements installation and the reported Sphinx gallery and multiprocessing errors; done means the basic HTML tutorial builds at _build/html without those errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.