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

Windows setup.py: Symlinking requires Admin Privileges #925

Closed
Jdaviz-Triage-Bot opened this issue Oct 8, 2021 · 8 comments · Fixed by #1218 or #1234
Closed

Windows setup.py: Symlinking requires Admin Privileges #925

Jdaviz-Triage-Bot opened this issue Oct 8, 2021 · 8 comments · Fixed by #1218 or #1234
Labels
bug Something isn't working

Comments

@Jdaviz-Triage-Bot
Copy link

Jdaviz-Triage-Bot commented Oct 8, 2021

Reporter: Duy Nguyen

In testing jdaviz on Windows 11, it almost worked flawlessly on Python 3.9.7 (latest py39), up until running the setup.py for jdaviz:

  Running setup.py develop for jdaviz
    ERROR: Command errored out with exit status 1:
     command: 'E:\STScI\gitRepos\jdaviz\envmain\Scripts\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'E:\\STScI\\gitRepos\\jdaviz\\setup.py'"'"'; __file__='"'"'E:\\STScI\\gitRepos\\jdaviz\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
         cwd: E:\STScI\gitRepos\jdaviz\
    Complete output (3 lines):
    running develop
    error: [WinError 1314] A required privilege is not held by the client: '..\\..\\..\\..\\..\\share\\jupyter\\nbconvert\\templates\\jdaviz-default' -> 'E:\\STScI\\gitRepos\\jdaviz\\envmain\\share\\jupyter\\nbconvert/templates\\jdaviz-default'
    ..\..\..\..\..\share\jupyter\nbconvert\templates\jdaviz-default -> E:\STScI\gitRepos\jdaviz\envmain\share\jupyter\nbconvert/templates\jdaviz-default
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'E:\STScI\gitRepos\jdaviz\envmain\Scripts\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'E:\\STScI\\gitRepos\\jdaviz\\setup.py'"'"'; __file__='"'"'E:\\STScI\\gitRepos\\jdaviz\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.

I found this discussion which I think points to the possible problem: AcademySoftwareFoundation/rez#594

and as it would suggest, when I reran the install as my System Administrator, the install worked. The problem would therein lie here:

jdaviz/setup.py

Line 141 in 0712a8c

os.symlink(rel_source, target)

This part of our setup.py is so opaque I can't understand what's going on here :/ But as our Windows Dev Advocate, I'd strongly recommend trying to resolve this!

🐱


DISCLAIMER: This issue was autocreated by the Jdaviz Issue Creation Bot on behalf of the reporter. If any information is incorrect, please contact Duy Nguyen

@pllim
Copy link
Contributor

pllim commented Oct 11, 2021

Looks like @nmearl introduced that symlink back in #61 .

@pllim pllim added the bug Something isn't working label Oct 11, 2021
@pllim
Copy link
Contributor

pllim commented Mar 29, 2022

Reply from @nmearl -- It is used to specify custom theming for Voila apps. I did not write it, but I did use it when I wrote the custom JDAViz theme. You can see it being used in other theming templates; from https://voila.readthedocs.io/en/stable/customize.html#creating-your-own-template, you can see it being used in the material ui theme (https://github.com/voila-dashboards/voila-material/blob/master/setup.py), and the vuetify theme (https://github.com/voila-dashboards/voila-vuetify/blob/master/setup.py).

So maybe @maartenbreddels or @mariobuikhuizen can clarify on how to fix this properly?

@maartenbreddels
Copy link
Collaborator

This is required for a dev install (i.e. pip install -e .). Is this something you need? Otherwise we can skip that step for windows.

@pllim
Copy link
Contributor

pllim commented Mar 29, 2022

Ideally, a developer on Windows would be able to also pip install -e ., yes. Is symlink absolutely needed or can you replace it with making a copy?

@pllim
Copy link
Contributor

pllim commented Mar 29, 2022

Or does copy also need admin priv?

@maartenbreddels
Copy link
Collaborator

No it doesn't need that. You could fallback to a copy, but then the template would not be editable in the source tree (you'd need to run pip install each time you edit, or copy manually).

@pllim
Copy link
Contributor

pllim commented Mar 29, 2022

Hmm, what a dilemma. @duytnguyendtn , what do you think?

@pllim
Copy link
Contributor

pllim commented Apr 6, 2022

#1218 reverted because of 🍎

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
3 participants