awslabs/fortuna

Installation

PaulScemama opened this issue ยท 18 comments

System: Mac M1

Just tried to install. First installed jax (CPU version) from the link provided. My pip list is:

Package    Version
---------- -------
jax        0.4.1
jaxlib     0.4.1
numpy      1.24.0
opt-einsum 3.3.0
pip        22.3.1
scipy      1.9.3
setuptools 58.1.0

Then running pip install aws-fortuna results in:

ERROR: Cannot install aws-fortuna==0.1.1, aws-fortuna==0.1.2, aws-fortuna==0.1.3, aws-fortuna==0.1.4 and aws-fortuna==0.1.5 because these package versions have conflicting dependencies.

The conflict is caused by:
    aws-fortuna 0.1.5 depends on tensorflow-cpu<3.0.0 and >=2.11.0
    aws-fortuna 0.1.4 depends on tensorflow-cpu<3.0.0 and >=2.11.0
    aws-fortuna 0.1.3 depends on tensorflow-cpu<3.0.0 and >=2.11.0
    aws-fortuna 0.1.2 depends on tensorflow-cpu<3.0.0 and >=2.11.0
    aws-fortuna 0.1.1 depends on tensorflow-cpu<3.0.0 and >=2.11.0

Do I need to separately install tensorflow?

Thanks for raising this. Looking into it.

It works for me on a Mac, python3.8.8. What version of python are you using?

About tensorflow, no, there is no need to install it separately.

I was using 3.10.5; I am installing 3.8.8 now and will let you know if it works. Thanks!

I tried python3.10.5, it also installs correctly. Currently I cannot reproduce your issue.

Happy to look further into it if the problem persists!

Thanks for letting me know! Apologies I was afk for a bit. I will also attempt to diagnose the issue. Are you using an M1 Mac?

No, I'm using a MacBook Pro.

Okay. It appears as though tensorflow does not support M1 Mac's directly. See Lescurel's answer here. However, apple hosts a tensorflow-macos package on pypi.

I made a fork and built a new poetry env by switching out tensorflow-cpu with tensorflow-macos in the pyproject.toml (btw I switched to poetry). I ran the first half of examples/bring_in_your_own.ipynb and it seems to be working.

Perhaps having an option to install with tensorflow-macos for Mac M1 could be nice?

Great job, Paul! Yes, it would be nice indeed.

Would you like to contribute and open a pull-request that makes the change to pyproject.toml? ๐Ÿ˜„ I would suggest trying to detect which OS is in use, and accordingly install either tensorflow-macos or tensorflow-cpu. Here you should be able to find how to do that.

Let me know if you have the time, otherwise I'll look into it myself. Thanks!

Thanks! :). I'd love to give it a go. I'll mention that due to my job it may take a little longer as I need to be approved to contribute to open source. I will start working on it asap though!

@gianlucadetommaso (tentatively) done with this issue. Just waiting on the go ahead from my work to create the PR. Will keep you posted!

Nice! Let me know ๐Ÿ˜„

@PaulScemama any updates, or any idea when you'll get the OK to go ahead? Being this an installation issue, I would love to have this solved asap ๐Ÿ˜„

@gianlucadetommaso I totally understand. Unfortunately the go ahead is still "awaiting review". I don't want to keep you waiting so I will just show you what I did here: in the pyproject.toml I deleted the tensorflow-cpu line under [tool.poetry.dependencies] and added the following two lines:

tensorflow-cpu = { version = "^2.11.0", markers = "sys_platform != 'darwin'" }
tensorflow-macos = { version = "^2.11.0", markers = "sys_platform == 'darwin'" } 

Although you most certainly already know this, you will have to do poetry update to update the poetry.lock file afterwards.

Note that I didn't test this much at all, so I apologize if it is wrong.

Also once my request is approved, I will be able to contribute freely. So hopefully I can help in other ways moving forward in a more substantial way.

Best wishes!

Alright, then I'll fix this. When you get the approval let me know, and I'll add you a posteriori as author of the commit. :)

That is very nice of you. Thank you and I will keep you posted :)

@gianlucadetommaso hi! Finally got approved so I am all good to go with contributing from here on out with no more extra delays. Looking forward to helping out!

Thanks :)

Cool. Would you send me your e-mail somewhere, so I can add you to the relevant commit?