decision-forests icon indicating copy to clipboard operation
decision-forests copied to clipboard

pip install does not work on Mac

Open erwtokritos opened this issue 3 years ago • 29 comments

Hey there,

First of all, congratulations for your effort, this is a great initiative!

I am raising this issue because I have faced a problem with installation. I have created a Python 3.8.6 virtual environment on my Mac and installed tensorflow 2.5.0 successfully. When I ran the installation command for the "Tensorflow Decision Forests" package, pip3 install tensorflow_decision_forests --upgrade

I got:

ERROR: Could not find a version that satisfies the requirement tensorflow_decision_forests (from versions: none) ERROR: No matching distribution found for tensorflow_decision_forests

It's a bit confusing because the installation command on PyPi (I guess this is the right one) contains dashes ,instead of underscores, in the package name.

Any ideas?

Thanks a lot

erwtokritos avatar May 31 '21 12:05 erwtokritos

Same stuff on Windows too. Let me add some other details of the environment where I installed tensorflow 2:

  • python version: 3.8.8
  • tensorflow version: 2.5.0
  • pip version: 21.1.2

I also noticed the same confusion between dashes and underscores. Seems strange to me

informatica92 avatar May 31 '21 14:05 informatica92

Looking at the files available in pip (here: https://pypi.org/project/tensorflow-decision-forests/#files) I noticed that all the available builds, have been made for linux only (python 3.6, 3.7, 3.8 and 3.9). So basically, no Windows and Mac support up to now

informatica92 avatar May 31 '21 14:05 informatica92

hi Thanos,

Indeed the Mac version is in our TODO list, as is with windows (see issue #3 ), hence pip not finding a matching tensorflow_decision_forests version.

We'll keep this issue opened and use it to post updates. Sorry about that.

janpfeifer avatar May 31 '21 14:05 janpfeifer

Thank you for your prompt response Looking forward to start playing with the library :)

Have a good day!

erwtokritos avatar May 31 '21 14:05 erwtokritos

For Mac/Windows users: a quick fix to get your feet wet while a version in pip is being prepared is to use the model in Google Colab, or if you are an advanced user that really wants to use a local install, you can create a docker with ubuntu.

(Incidentally, @janpfeifer no need to apologise! Best to put a version out there and keep adding more things than wait. Thanks very much to you and your team for your work on tfdf)

dkgaraujo avatar Jun 16 '21 06:06 dkgaraujo

@janpfeifer Look forward to the MAC version update, thank you!

ericzhangcn1980 avatar Nov 19 '21 11:11 ericzhangcn1980

Hey @janpfeifer, are there any updates or rough timelines you might have on this? As now TFX also has experimental support for tfdf, I think a mac runnable version is very much in need to facilitate a good dev experience.

AlirezaSadeghi avatar Jan 28 '22 13:01 AlirezaSadeghi

hi @AlirezaSadeghi, this was very timely, since @achoum just released the Mac version yesterday, v0.2.3:

https://github.com/tensorflow/decision-forests/releases/tag/0.2.3

Let us know how it goes -- it's new, so there may be some initial bumps (hopefully none). And apologies it took so long, there were some issues in TF build process that only now got sorted out (afaik).

janpfeifer avatar Jan 28 '22 18:01 janpfeifer

Super. Thanks @janpfeifer and will do!

AlirezaSadeghi avatar Jan 28 '22 18:01 AlirezaSadeghi

The Mac version should be in pip:

https://pypi.org/project/tensorflow-decision-forests/#files

janpfeifer avatar Jan 28 '22 18:01 janpfeifer

I'm still unsuccessful in installing from pip:

Python 3.8.10
pip 22.0.3

When I try to install from pip (pip install tensorflow-decision-forests==0.2.3) I get the following error:

ERROR: Could not find a version that satisfies the requirement tensorflow-decision-forests==0.2.3 (from versions: none)
ERROR: No matching distribution found for tensorflow-decision-forests==0.2.3

Is this expected?

JanetVictorious avatar Feb 04 '22 13:02 JanetVictorious

Currently, TF-DF is only exported for python 3.9 on MacOS (see https://pypi.org/project/tensorflow-decision-forests/#files for the list of supported versions).

Until this is extended to other python version, can you try installing it again, but with python 3.9?

achoum avatar Feb 04 '22 16:02 achoum

Hi. I was going to get the whl file and install it (https://pypi.org/project/tensorflow-decision-forests/#files)

but i got: ERROR: tensorflow_decision_forests-0.2.3-cp39-cp39-macosx_12_0_x86_64.whl is not a supported wheel on this platform. also ERROR: tensorflow_decision_forests-0.2.4-cp39-cp39-macosx_12_0_x86_64.whl is not a supported wheel on this platform.

My environment:

macos big sur 11.6
python version: 3.9.10 with anaconda
tensorflow version: 2.7.0
pip version: 22.0.3

I think I got the right whl file, but it's weird. Does anyone know the reason?

cacacoo avatar Feb 05 '22 01:02 cacacoo

Thank you @achoum, that did the trick!

JanetVictorious avatar Feb 05 '22 12:02 JanetVictorious

@cacacoo

My best guess is the version of MacOS (macosx 12 vs macosx 11). I am not certain there is effectively a difference (like for the version of python), and I would try renaming the .whl file and editing /tensorflow_decision_forests-0.2.4.dist-info/WHEEL accordingly.

Ultimately, we will provide all the right versions directly in pip :), so thanks for your patience with all of this.

achoum avatar Feb 07 '22 17:02 achoum

Hi!

I am running: pip3 install tensorflow_decision_forests-0.2.4-cp39-cp39-macosx_12_0_x86_64.whl

on macos 12.2 Monterey with Python 3.9.0 on a 64bit architecture.

but I still get: ERROR: tensorflow_decision_forests-0.2.4-cp39-cp39-macosx_12_2_x86_64.whl is not a supported wheel on this platform.

Anyone else?

b3rge avatar Feb 09 '22 19:02 b3rge

me too!

ericzhangcn1980 avatar Feb 10 '22 03:02 ericzhangcn1980

@achoum Thank you!

I modified the whl file name from 12 to 11 to fit my macos version and pip installed it. tensorflow_decision_forests-0.2.4-cp39-cp39-macosx_11_0_x86_64.whl

editing /tensorflow_decision_forests-0.2.4.dist-info/WHEEL accordingly. Can you explain this in more detail? Is there a problem if I don't do it?

cacacoo avatar Feb 10 '22 05:02 cacacoo

Upvoting a mac version for py3.8

ynait avatar Feb 15 '22 17:02 ynait

Hi,

Python 2.8 @cacacoo

TF-DF is now released for python 2.{7,8,9} on MacOS12

See the files: https://pypi.org/project/tensorflow-decision-forests/#files

@b3rge @ericzhangcn1980

Unfortunately, we are currently lacking MacOS experience, therefore we don't have a good solution to those issues. If you figure them out and share the results though, this would be awesome.

My 2 cents:

According the the exported Pip file for macos (see https://pypi.org/project/tensorflow-decision-forests/#files), we currently support :"macosx_12_0_x86_64" for python 2.{7,8,9}.

@b3rge

In your error, the macos version is macosx_12_2_x86_64. I am not sure of what the "2" means (maybe a new sub version), but it would be strange not to have backward compatibility between these two versions. My best guess is that we/you need to find a way to force your pip to install this version.

In addition to the filename, the only other version specific information is in the file "/tensorflow_decision_forests-0.2.4.dist-info/WHEEL". I would not try this approach first, but editing the filename the WHEEL file content might work.

achoum avatar Feb 16 '22 11:02 achoum

Hi all,

since we're working with macOS I was thrilled to get the support! We may have found a workaround, for the time being, for this wheel files.

Setup

  1. macOS Monterey Version 12.2.1
  • Processor: 2,6 GHz 6-Core Intel Core i7
  1. Python Version: 3.9.5
  2. pip Version: 22.0.3

Workaround

  1. Download tensorflow_decision_forests-0.2.4-cp39-cp39-macosx_12_0_x86_64.whl from here
  2. Rename file to tensorflow_decision_forests-0.2.4-cp39-none-any.whl
  3. $ pip install tensorflow_decision_forests-0.2.4-cp39-none-any.whl

After that I was able to import tfdf and train a model.

Best regards,

Timo

omit-ai avatar Feb 18 '22 11:02 omit-ai

Thanks @Timo3as for posting your workaround here. Indeed we lack MacOS expertise in our small team :\

Let's keep the issue opened until we find a way to test and release pip packages to the various MacOS versions.

janpfeifer avatar Feb 23 '22 07:02 janpfeifer

Thanks @Timo3as, your workaround worked for me also.

tlapusan avatar Mar 09 '22 15:03 tlapusan

@janpfeifer, can you tell me when tfdf will be available for Windows?

varunkarwa avatar Mar 10 '22 02:03 varunkarwa

hi @varunkarwa , we are actually waiting for TensorFlow Custom Ops to work again for Windows -- TF-DF uses a "custom op" for Tensorflow.

But at home I have a windows box and I use TF-DF always on WSL (windows sub-system for linux), where I run the kernel for my notebooks. It works really nicely, I recommend. And in WSL2 it must be almost as fast I would think. (Generally my models at home are smaller, so it's always very fast).

#3 is the issue tracking WIndows support.

Also notice that Yggdrasil, the underlying C++ implementation of the algorithms, work for WIndows. So you can link it to do inference in a windows program for instance.

janpfeifer avatar Mar 10 '22 08:03 janpfeifer

me too,not work on Mac OS m1

pimatrix avatar Apr 27 '22 05:04 pimatrix

me too,not work on Mac OS m1

check comment from @Timo3as. His workaround worked for me on Mac.

tlapusan avatar Apr 27 '22 06:04 tlapusan

me too,not work on Mac OS m1

check comment from @Timo3as. His workaround worked for me on Mac.

Yes it works on Intel Core i7,but failed on Mac of m1

pimatrix avatar May 09 '22 08:05 pimatrix

Has anything changed now?

sun1638650145 avatar Aug 08 '22 02:08 sun1638650145

hi all, just wanted to update on unfortunately "no updates" for M1 yet. TensorFlow on M1 doesn't make it easy to support "TensorFlow Custom Ops", which we need for TF-DF :( ... since we don't yet have an update on this on TF side, we can't provide one for TF-DF either.

A question for those interested: if for Mac M1 we had a Decision Forests model working in pure Python -- mostly with the same API, just not integrated into TensorFlow.

The model could be used with numpy, matplotlib, notebook etc. And after training/developing with these models, it could be exported for TF Serving (for Linux). Would such a stop-gap solution be useful ?

janpfeifer avatar Aug 18 '22 10:08 janpfeifer