Issues with Python dependencies on MacBook M1 Pro #44
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I get several errors when I try to run the 0_setup.sh on my machine.
M1 Pro with 16GB
Python version: 3.9.7
ERROR: Failed building wheel for numpy Failed to build lumpy ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projectsERROR: Could not find a version that satisfies the requirement opencv-contrib-python-headless==4.4.0.46 (from versions: 3.4.11.45, 3.4.13.47, 3.4.14.51, 3.4.15.55, 3.4.16.57, 4.4.0.46, 4.5.1.48, 4.5.2.52, 4.5.3.56, 4.5.4.58) ERROR: No matching distribution found for opencv-contrib-python-headless==4.4.0.46@bufo24 thanks a lot for reporting! Looking into it.
Hey @bufo24! I pushed a fix just now. Could you please confirm if it works for you now?
Just playing around with this on an M1 Mac, I still get the following error (looks like somewhere on the chain Python 3.10 is being used, even though my python3 version is
3.9.7):@rdlauer I would suggest to try deleting the temp directory
.dflthat is created by the scripts as it contains the virtual env. If you attempted to run this on Python 3.10 before, then the virtual env may still contain Python 3.10.I'm a little confused as it looks like
.dflis created as part of the setup script? This error is on the initial run of that script (so there is no.dfldirectory to delete). Not sure if this will tell you anything:I guess it's this line that stands out to me:
created virtual environment CPython3.10.0.final.0-64@rdlauer Yes, indeed, the issue is that Python 3.10 in your env is still picked up as the active one.
I would recommend using https://github.com/pyenv/pyenv. It helps with managing multiple Python versions.
Once you have it installed, you can install Python 3.9.7 with command:
and then make it active with command:
Basically, for these scripts to work you need to make sure that in your shell command
python3 -VgivesPython 3.9.7.Hopefully, this is helpful.
I'll try that, but right now I only have 3.9.7 installed:
@rdlauer Could you please also share what
virtualenv --versionreturns?Interesting:
Ok, looks like that's the problem. The
pyenvshould help with that.I appreciate the tips! Yeah this is strange, even after trying
pyenvI see output from the setup scriptUsing requirements.txt for Python 3.10.0.Hey @rdlauer!
Recently, I upgraded my Mac to OS X 12 and installed Python 3.10 and I started having the same issue. And I was able to fix it by adding this line to the end of my
~/.zshrc(add it to your.bash_profileif you're using Bash):And make sure you restart your shell.
After that on my Mac everything works as expected:
Thanks - but this is where my lack of Python knowledge is killing me :)
I wonder if it's because homebrew is managing my virtualenv installation?
@rdlauer I don't think it is because of homebrew. You need to make sure the
$HOME/.pyenv/shimsis at the beginning of yourPATH. Could you please try this sequence of commands and share the output:Happy to:
@rdlauer Ok, one more thing. Try this:
Same virtualenv version is returned:
Should I be targeting virtualenv 20.4.2 when I install it? Something like:
pyenv exec pip install virtualenv==20.4.2?I don't think it is related to a specific version of
virtualenv, but rather which python version it belongs to.In either case, I would suggest you to report this issue and ask for advice in https://github.com/pyenv/pyenv (or maybe it has already been discussed and solved there). The issue is not caused by scripts in this repo.
The issue is tagged as "stale issue" due to no activity in 30 days. If there is no activity for 15 more days, the issue will be closed.
I tried all the hints from above and downgraded my python version from 3.10 to 3.9.7 with pyenv.
But while installing I get this error:
Scripts seems to use requirements_3.6.txt instead of requirements_3.9.txt, while it is recognizing Python 3.10.1 instead of the 3.9.7 version that was set with pyenv. Weird.
Any hints?
I corrected the version numbers (used "yolk -V appname" to get versions, install with "pip install yolk3k") in requirements.txt but failed with tensorflow. yolk shows version 2.7.0 but "pip install tensorflow" and "pip3 install tensorflow" both fail.
Hi @gimmel! Yeah, we don't have a
requirements.txtfile for Python 3.10 yet. But also, the M1 chip creates additional issues because it is ARM64 and some of the python packages are not compatible with it. Working on it.With https://github.com/chychkan/DeepFaceLab_MacOS/pull/71 we've added partial support for Apple M1 laptops.
The only remaining issue is with XSeg editor and for that we've opened https://github.com/chychkan/DeepFaceLab_MacOS/issues/77. So, closing this one now.