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

cannot install theme on windows from current main #523

Closed
drammock opened this issue Dec 3, 2021 · 9 comments · Fixed by #533
Closed

cannot install theme on windows from current main #523

drammock opened this issue Dec 3, 2021 · 9 comments · Fixed by #533

Comments

@drammock
Copy link
Collaborator

drammock commented Dec 3, 2021

I'm testing #436 over at mne-tools/mne-python#9916. It works (yay! here's the CI artifact with the theme's dropdown in action) BUT one of our other CIs tests whether our docs can be built on windows. That failed, and I reproduced locally in a Windows VM. Here's how it fails:

(test) C:\Users\drmccloy>pip install https://github.com/pydata/pydata-sphinx-theme/archive/31299f7921803ce8e0844ddda2efe9c5e6c3a517.zip
Collecting https://github.com/pydata/pydata-sphinx-theme/archive/31299f7921803ce8e0844ddda2efe9c5e6c3a517.zip
  Downloading https://github.com/pydata/pydata-sphinx-theme/archive/31299f7921803ce8e0844ddda2efe9c5e6c3a517.zip
     / 1.2 MB 68 kB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\drmccloy\anaconda3\envs\test\python.exe' 'C:\Users\drmccloy\anaconda3\envs\test\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' get_requires_for_build_wheel 'C:\Users\drmccloy\AppData\Local\Temp\tmpty6ajtz3'
       cwd: C:\Users\drmccloy\AppData\Local\Temp\pip-req-build-z2gx2qjy
  Complete output (26 lines):
  Traceback (most recent call last):
    File "C:\Users\drmccloy\anaconda3\envs\test\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 349, in <module>
      main()
    File "C:\Users\drmccloy\anaconda3\envs\test\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 331, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "C:\Users\drmccloy\anaconda3\envs\test\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 111, in get_requires_for_build_wheel
      backend = _build_backend()
    File "C:\Users\drmccloy\anaconda3\envs\test\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 89, in _build_backend
      obj = import_module(mod_path)
    File "C:\Users\drmccloy\anaconda3\envs\test\lib\importlib\__init__.py", line 126, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
    File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
    File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
    File "<frozen importlib._bootstrap_external>", line 883, in exec_module
    File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
    File "C:\Users\drmccloy\AppData\Local\Temp\pip-build-env-yqp82dyu\overlay\Lib\site-packages\sphinx_theme_builder\__init__.py", line 16, in <module>
      from ._internal.distributions import generate_metadata as _generate_metadata
    File "C:\Users\drmccloy\AppData\Local\Temp\pip-build-env-yqp82dyu\overlay\Lib\site-packages\sphinx_theme_builder\_internal\distributions.py", line 13, in <module>
      from .nodejs import generate_assets
    File "C:\Users\drmccloy\AppData\Local\Temp\pip-build-env-yqp82dyu\overlay\Lib\site-packages\sphinx_theme_builder\_internal\nodejs.py", line 18, in <module>
      from .passthrough import passthrough_run
    File "C:\Users\drmccloy\AppData\Local\Temp\pip-build-env-yqp82dyu\overlay\Lib\site-packages\sphinx_theme_builder\_internal\passthrough.py", line 96, in <module>
      def passthrough_run(args: List[str]) -> int:
  NameError: name 'List' is not defined. Did you mean: 'list'?
  ----------------------------------------
WARNING: Discarding https://github.com/pydata/pydata-sphinx-theme/archive/31299f7921803ce8e0844ddda2efe9c5e6c3a517.zip. Command errored out with exit status 1: 'C:\Users\drmccloy\anaconda3\envs\test\python.exe' 'C:\Users\drmccloy\anaconda3\envs\test\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' get_requires_for_build_wheel 'C:\Users\drmccloy\AppData\Local\Temp\tmpty6ajtz3' Check the logs for full command output.
ERROR: Command errored out with exit status 1: 'C:\Users\drmccloy\anaconda3\envs\test\python.exe' 'C:\Users\drmccloy\anaconda3\envs\test\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' get_requires_for_build_wheel 'C:\Users\drmccloy\AppData\Local\Temp\tmpty6ajtz3' Check the logs for full command output.
@jorisvandenbossche
Copy link
Member

Good to hear the version stuff is working!

Regarding the failure, I suppose that's something to report at https://github.com/pradyunsg/sphinx-theme-builder/ (cc @pradyunsg)

@pradyunsg
Copy link
Contributor

pradyunsg commented Dec 4, 2021

Yea, I need to cut a release of stb with this fixed. It's fixed on main there. 🙈

@pradyunsg
Copy link
Contributor

Alright, try now. :)

@drammock
Copy link
Collaborator Author

drammock commented Dec 5, 2021

thanks for the quick turnaround! It fails differently now though, here's an excerpt from the CI log:

  Building wheel for pydata-sphinx-theme (pyproject.toml): started
  Building wheel for pydata-sphinx-theme (pyproject.toml): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: 'C:\Miniconda\python.exe' 'C:\Miniconda\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\VSSADM~1\AppData\Local\Temp\tmp3_tjb_9y'
       cwd: C:\Users\VssAdministrator\AppData\Local\Temp\pip-req-build-6hfj72tt
  Complete output (17 lines):
  [stb] # nodeenv does not exist.
  [stb] # Generating new nodeenv with NodeJS 14.18.1!
  [stb] # The system `node` has a different version: {}
  [stb] $ python -m nodeenv --node=14.18.1
  C:\Users\VssAdministrator\AppData\Local\Temp\pip-req-build-6hfj72tt\.nodeenv
   * Install prebuilt node (14.18.1) ..... done.
  symbolic link created for C:\Users\VssAdministrator\AppData\Local\Temp\pip-req-build-6hfj72tt\.nodeenv\Scripts\nodejs.exe <<===>> node.exe
  [stb] (nodeenv) $ node --version
  v16.13.0
  error: nodeenv-version-mismatch
  x The `nodeenv` for this project is unhealthy.
  
  There is a mismatch between what is present in the environment (v16.13.0) and the expected version of NodeJS (v14.18.1).
  
  hint: Deleting the .nodeenv directory and trying again may work.
  
  Link: https://sphinx-theme-builder.rtfd.io/errors/#nodeenv-version-mismatch
  ----------------------------------------
  ERROR: Failed building wheel for pydata-sphinx-theme

I'll try to sort this out next week if I can, but I'm all ears if you can quickly spot what is wrong.

@drammock
Copy link
Collaborator Author

drammock commented Dec 28, 2021

OK, I just tried again to install into a windows 10 VM, and I'm getting similar errors there as those seen on the CI log above.

Here's what I did (in a mambaforge prompt):

conda create -n pst python=3
git clone https://github.com/pydata/pydata-sphinx-theme
cd pydata-sphinx-theme
pip install .[dev]

Here's the last bit of the output, after all the dependencies have been downloaded / installed:

Building wheels for collected packages: pydata-sphinx-theme, pyrsistent, tornado, sphinx-sitemap
  Building wheel for pydata-sphinx-theme (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\drmccloy\mambaforge\envs\pst\python.exe' 'C:\Users\drmccloy\mambaforge\envs\pst\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\drmccloy\AppData\Local\Temp\tmpnoabsb82'
       cwd: C:\Users\drmccloy\AppData\Local\Temp\pip-req-build-jcou4d9i
  Complete output (18 lines):
  [stb] # nodeenv does not exist.
  [stb] # Generating new nodeenv with NodeJS 14.18.1!
  [stb] # Could not find a `node` executable.
  [stb] $ python -m nodeenv --node=14.18.1
  C:\Users\drmccloy\AppData\Local\Temp\pip-req-build-jcou4d9i\.nodeenv
   * Install prebuilt node (14.18.1) ..... done.
  You do not have sufficient privilege to perform this operation.
  You do not have sufficient privilege to perform this operation.
  Error: Failed to create nodejs.exe link
  [stb] (nodeenv) $ node --version
  error: nodeenv-unhealthy-file-not-found
  x The `nodeenv` for this project is unhealthy.

  None

  hint: Deleting the .nodeenv directory and trying again may work.

  Link: https://sphinx-theme-builder.rtfd.io/errors/#nodeenv-unhealthy-file-not-found
  ----------------------------------------
  ERROR: Failed building wheel for pydata-sphinx-theme
  Building wheel for pyrsistent (PEP 517) ... done
  Created wheel for pyrsistent: filename=pyrsistent-0.18.0-cp310-cp310-win_amd64.whl size=47734 sha256=125c70a9be57010737c7716ebe6cf01cdeb27961c2357a4ed6feb087586d9769
  Stored in directory: c:\users\drmccloy\appdata\local\pip\cache\wheels\bf\ee\17\b548a960bb9e20daf7987f316c326e8a368603809ace3b2374
  Building wheel for tornado (setup.py) ... done
  Created wheel for tornado: filename=tornado-6.1-cp310-cp310-win_amd64.whl size=414480 sha256=2974938fa37772dd8d5372a8fc2a972051a795fee8d7efaa56d51fd8733b14dd
  Stored in directory: c:\users\drmccloy\appdata\local\pip\cache\wheels\80\32\8d\21cf0fa6ee4e083f6530e5b83dfdfa9489a3890d320803f4c7
  Building wheel for sphinx-sitemap (setup.py) ... done
  Created wheel for sphinx-sitemap: filename=sphinx_sitemap-2.2.0-py3-none-any.whl size=6065 sha256=bef4f8d8471926c04c338a25e12d1b22f7ff3788a9d5f1c53686298407850b7e
  Stored in directory: c:\users\drmccloy\appdata\local\pip\cache\wheels\2b\13\98\a3a68cf2efaf51a2eaf69f1d138d2749bd1aeceb3d2d455aeb
Successfully built pyrsistent tornado sphinx-sitemap
Failed to build pydata-sphinx-theme
ERROR: Could not build wheels for pydata-sphinx-theme which use PEP 517 and cannot be installed directly

Since I spotted a permissions error in there, I deleted and recreated the env, and tried pip's new --use-feature=in-tree-build in case there was something weird going on with tempdir permissions in my VM. That seems not to have helped:

Building wheels for collected packages: pydata-sphinx-theme
  Building wheel for pydata-sphinx-theme (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\drmccloy\mambaforge\envs\pst\python.exe' 'C:\Users\drmccloy\mambaforge\envs\pst\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\drmccloy\AppData\Local\Temp\tmpaw_iildy'
       cwd: C:\Users\drmccloy\Desktop\pydata-sphinx-theme
  Complete output (18 lines):
  [stb] # nodeenv does not exist.
  [stb] # Generating new nodeenv with NodeJS 14.18.1!
  [stb] # Could not find a `node` executable.
  [stb] $ python -m nodeenv --node=14.18.1
  C:\Users\drmccloy\Desktop\pydata-sphinx-theme\.nodeenv
   * Install prebuilt node (14.18.1) ..... done.
  You do not have sufficient privilege to perform this operation.
  You do not have sufficient privilege to perform this operation.
  Error: Failed to create nodejs.exe link
  [stb] (nodeenv) $ node --version
  error: nodeenv-unhealthy-file-not-found
  x The `nodeenv` for this project is unhealthy.

  None

  hint: Deleting the .nodeenv directory and trying again may work.

  Link: https://sphinx-theme-builder.rtfd.io/errors/#nodeenv-unhealthy-file-not-found
  ----------------------------------------
  ERROR: Failed building wheel for pydata-sphinx-theme
Failed to build pydata-sphinx-theme
ERROR: Could not build wheels for pydata-sphinx-theme which use PEP 517 and cannot be installed directly

Looks like the same problem @kapooramit posted about here: pradyunsg/sphinx-theme-builder#7 (comment)

Next I tried deleting & recreating the env, but running the installation through mambaforge prompt in "run as administrator" mode (still using in-tree-build). Still fails:

Building wheels for collected packages: pydata-sphinx-theme
  Building wheel for pydata-sphinx-theme (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\drmccloy\mambaforge\envs\pst\python.exe' 'C:\Users\drmccloy\mambaforge\envs\pst\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\drmccloy\AppData\Local\Temp\tmpsgx7ckxx'
       cwd: C:\Users\drmccloy\Desktop\pydata-sphinx-theme
  Complete output (9 lines):
  [stb] (nodeenv) $ node --version
  error: nodeenv-unhealthy-file-not-found
  x The `nodeenv` for this project is unhealthy.

  None

  hint: Deleting the .nodeenv directory and trying again may work.

  Link: https://sphinx-theme-builder.rtfd.io/errors/#nodeenv-unhealthy-file-not-found
  ----------------------------------------
  ERROR: Failed building wheel for pydata-sphinx-theme
Failed to build pydata-sphinx-theme
ERROR: Could not build wheels for pydata-sphinx-theme which use PEP 517 and cannot be installed directly

I note (with some frustration) that the link in the error message (https://sphinx-theme-builder.rtfd.io/errors/#nodeenv-unhealthy-file-not-found) goes to a page that does not exist. Next I tried the "hint" that deleting the .nodeenv directory might help. This time I didn't recreate the environment; after the prior failure I immediately ran this:

rmdir /S .nodeenv
pip install .[dev] --use-feature=in-tree-build

it failed again:

Building wheels for collected packages: pydata-sphinx-theme
  Building wheel for pydata-sphinx-theme (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\drmccloy\mambaforge\envs\pst\python.exe' 'C:\Users\drmccloy\mambaforge\envs\pst\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\drmccloy\AppData\Local\Temp\tmp34hnv4z0'
       cwd: C:\Users\drmccloy\Desktop\pydata-sphinx-theme
  Complete output (16 lines):
  [stb] # nodeenv does not exist.
  [stb] # Generating new nodeenv with NodeJS 14.18.1!
  [stb] # Could not find a `node` executable.
  [stb] $ python -m nodeenv --node=14.18.1
  C:\Users\drmccloy\Desktop\pydata-sphinx-theme\.nodeenv
   * Install prebuilt node (14.18.1) ..... done.
  symbolic link created for C:\Users\drmccloy\Desktop\pydata-sphinx-theme\.nodeenv\Scripts\nodejs.exe <<===>> node.exe
  [stb] (nodeenv) $ node --version
  error: nodeenv-unhealthy-file-not-found
  x The `nodeenv` for this project is unhealthy.

  None

  hint: Deleting the .nodeenv directory and trying again may work.

  Link: https://sphinx-theme-builder.rtfd.io/errors/#nodeenv-unhealthy-file-not-found
  ----------------------------------------
  ERROR: Failed building wheel for pydata-sphinx-theme
Failed to build pydata-sphinx-theme
ERROR: Could not build wheels for pydata-sphinx-theme which use PEP 517 and cannot be installed directly

Any ideas what I should try next?

@pradyunsg
Copy link
Contributor

This needs me to have access to a machine that reproduces this failure. The problem originates from this module here where, somehow, nodeenv isn't generating a valid node environment in your use case.

https://github.com/pradyunsg/sphinx-theme-builder/blob/main/src/sphinx_theme_builder/_internal/nodejs.py#L170

@drammock
Copy link
Collaborator Author

This needs me to have access to a machine that reproduces this failure.

as I said above, I'm seeing this in a windows 10 VM. Windows 10 ISO files are available here; I'm using VirtualBox but any VM manager ought to work. Once it's up and running:

I think that ought to be enough to allow the following in a mambaforge prompt:

mamba create -n pst_test python=3
conda activate pst_test
git clone https://github.com/pydata/pydata-sphinx-theme
cd pydata-sphinx-theme
pip install .[dev]

@choldgraf
Copy link
Collaborator

@pradyunsg to try this out I opened a PR that adds a Windows build here: #533

The windows job does indeed break at the install step. Here's a link to the error:

https://github.com/pydata/pydata-sphinx-theme/runs/4655097854?check_suite_focus=true#step:4:220

@drammock
Copy link
Collaborator Author

drammock commented Jan 4, 2022

I confirm that the installation steps in my earlier post now work in my windows VM 🎉 and MNE-Python's CI that tests building the docs on Windows also succeeded. Thanks @pradyunsg for tracking down the culprit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants