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

Apple M1 Monterey - Cant install Rez #1170

Closed
sbissonnette opened this issue Dec 8, 2021 · 15 comments
Closed

Apple M1 Monterey - Cant install Rez #1170

sbissonnette opened this issue Dec 8, 2021 · 15 comments
Labels

Comments

@sbissonnette
Copy link

I'm not able to install rez on my macbook pro M1 Pro (Monterey 12.0.1).

If I'm trying to install it with python2 system interpreter I get this:

❯ sudo python ./install.py
installing rez to /opt/rez...
ERROR: The executable /opt/rez/bin/python is not functioning
ERROR: It thinks sys.prefix is '/Users/samuelbissonnette/git/rez' (should be u'/opt/rez')
ERROR: virtualenv is not compatible with this system or executable

I also tried with Python3 from homebrew but no success... Here are the logs:

❯ sudo python3 ./install.py
installing rez to /opt/rez...
Traceback (most recent call last):
  File "/Users/samuelbissonnette/git/rez/./install.py", line 311, in <module>
    install(dest_dir, print_welcome=True)
  File "/Users/samuelbissonnette/git/rez/./install.py", line 161, in install
    install_rez_from_source(dest_dir)
  File "/Users/samuelbissonnette/git/rez/./install.py", line 223, in install_rez_from_source
    run_command([py_executable, "-m", "pip", "install", "."])
  File "/Users/samuelbissonnette/git/rez/./install.py", line 89, in run_command
    return subprocess.check_output(args, cwd=source_path)
  File "/opt/homebrew/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/opt/homebrew/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/opt/rez/bin/python', '-m', 'pip', 'install', '.']' died with <Signals.SIGKILL: 9>.

Other than that I never had these issues on an Intel Mac.
Am I missing something?

@sbissonnette
Copy link
Author

I also tried with Python3 from Conda and I have the exact same result from above (Same logs as python3 from HomeBrew)

@nerdvegas
Copy link
Contributor

This one will take some digging. I can't give a timeline but thanks for flagging it.

@hughetop
Copy link

I am similarly unable to install on osx. Trying to install onto a network like:

% python3 install.py -v /Volumes/work/Tools/Applications/Rez/osx/rez
installing rez to /Volumes/work/Tools/Applications/Rez/osx/rez...

It will create a few files for the virtual env but then get stuck forever. I've left it for over an hour and it never gets any farther.
I sort of successfully installed to ~/Applications/rez for a test, but then the activate script doesn't set the correct $PATH. I can source the activate script, and my prompt correctly adds (rez) to it, but none of the rez commands are available.

hughetop@PXGJ3WM64C ~ % source /Users/hughetop/Applications/rez/bin/activate
(rez) hughetop@PXGJ3WM64C ~ % rez-env -h
zsh: command not found: rez-env

@nerdvegas
Copy link
Contributor

nerdvegas commented Mar 23, 2022 via email

@hughetop
Copy link

hughetop commented Mar 23, 2022

Oh, what is the intended way to activate rez on osx?
On windows it's calling the activate.bat script which works fine. Similarly, sourcing activate from git-bash on windows works. I have not tested the activate.ps1 script for powershell so I don't know how that works.

Edit: I see what you mean. All the rez-* executables are in bin/rez, not bin itself. So should the activate script add bin/rez to $PATH instead?

@nerdvegas
Copy link
Contributor

nerdvegas commented Mar 23, 2022 via email

@hughetop
Copy link

hughetop commented Mar 23, 2022

Sorry, the windows stuff is a bit off topic. I'm building a pipeline with rez on windows and everything is going well so far. I'm also investigating using rez on osx, which is what prompted this.
After the install.py script finishes, it tells you to add a directory to $PATH (or %PATH% on windows) to enable rez. But due to strange circumstances, we don't have admin on all the computers so we've been running the "activate" scripts instead. They function similarly to activating a virtual environment and so far that has been working great. Unfortunately the "activate" script from the osx install does not seem to add the correct directory to $PATH. Or rather, the rez-* executables don't get built to the correct directory.

Edit: looks like the "activate" script is the virtual environment. So it's entirely possible I've been doing this wrong the whole time.

@instinct-vfx
Copy link
Contributor

Not Mac User, let alone M1, but activating the virtualenv is also not a good idea on windows and might come with unexpected (and hard to troublehoot issues). You also do not need to add to Maschine level PATH. You can add it to user PATH or even just within a shell for that specific shell session.

@hughetop
Copy link

I see now that I've been using rez on windows incorrectly. But that should be an easy thing for me to fix. Ignore my windows questions.
Installing rez on osx to a network share, however, is still a bit of a problem. It seems to get stuck when creating it's virtual environment. When I cancel I get this traceback:

installing rez to /Volumes/work/Tools/Applications/Rez/osx/rez...
^CTraceback (most recent call last):
  File "/Volumes/work/Tools/Applications/Rez/config/rez-src-2.104.9/install.py", line 305, in <module>
    install(dest_dir, print_welcome=True)
  File "/Volumes/work/Tools/Applications/Rez/config/rez-src-2.104.9/install.py", line 147, in install
    create_virtual_environment(dest_dir)
  File "/Volumes/work/Tools/Applications/Rez/config/rez-src-2.104.9/install.py", line 48, in create_virtual_environment
    builder.create(dest_dir)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/venv/__init__.py", line 75, in create
    self._setup_pip(context)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/venv/__init__.py", line 313, in _setup_pip
    subprocess.check_output(cmd, stderr=subprocess.STDOUT)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 507, in run
    stdout, stderr = process.communicate(input, timeout=timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1121, in communicate
    stdout = self.stdout.read()
KeyboardInterrupt

So something in the venv creation is failing and hanging forever.

@JeanChristopheMorinPerso
Copy link
Member

@hughetop The virtualenv created by rez is not made to be used as is. Also the rez-* binaries are not installed directly under the bin directory of the virtualenv because we absolutely don't want the other binaries there (python, etc) to interfere with a rez environment. See https://github.com/nerdvegas/rez/blob/master/install.py#L92-L94.

@nerdvegas
Copy link
Contributor

nerdvegas commented Mar 24, 2022 via email

@JeanChristopheMorinPerso
Copy link
Member

JeanChristopheMorinPerso commented Mar 24, 2022

As for the hang, I would try to create a virtualenv on your network share using python -m venv and try to install any PyPI package inside it.

Edit: Looks like Allan was faster than me. Our answers are basically the same.

@hughetop
Copy link

So the osx install on a network share, python3 -m venv took about 5 minutes to finish but eventually did. But venv.EnvBuilder(with_pip=True).create(dest_dir) stalled when trying to create the files in the "lib/python3.9/site-packages" directory. That's likely an issue with the python3.9 install, or possibly the network.

Now the "fun" windows thing. These lines here clean up the rez bin files that were created in the virtualenv. The specs.keys() returns a list like ['rez', 'rezolve', '_rez-complete', '_rez_fwd', 'rez-bind', 'rez-build', ...], but on windows the files all have the ".exe" extension. Meaning the line if os.path.isfile(filepath): always returns False, and those files never get deleted. Fast forward to me trying to enable rez without editing $PATH because I don't have local admin. I saw the "activate" scripts and thought "Oh, maybe you can enable rez similar to a virtual env?" not realizing that it was the virtualenv that rez itself uses. And because those files never got cleaned up, activating that venv gave access to all the rez-* executables. So this entire time, rez only worked for me by crazy coincidence because of that bug in the install process. What a rollercoaster this has been.

@nerdvegas
Copy link
Contributor

nerdvegas commented Mar 24, 2022 via email

@sbissonnette
Copy link
Author

This is working now.

Specs:

  • MacOS 12.3.1 (21E258)
  • Rez 2.109.0
  • Python 3.10.4 (Install from python.org universal2 Installer)
    (Also works with 3.9.12 from Brew)

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

No branches or pull requests

5 participants