RafazZ
RafazZ

Reputation: 4578

How to install TensorFlow Developer version for both Python2 and Python3

I was working on the TensorFlow Dev version, and when running the build tests, I can run them only using Python 2 or Python 3 but not both. Currently I am using a soolution where I have two virtual environments, one for 2 and one for 3. This is inconvenient because whenever I want to test my changes to the TF, I have to migrate those changes to the other environment and run them there separately. This is error prone, and really tedious.

Another approach I have tried before is running either my_setup_for_python2(...); python setup.py develop or my_setup_for_python3(...); python3 setup.py develop, depending on what I am testing. This is very time consuming, and also not convenient.

I know that TF dev files are linked, and not copied. The question is if there is a way to follow the instructions here but installing the dev for both python2 and python3.

Upvotes: 1

Views: 403

Answers (1)

gunan
gunan

Reputation: 927

By Dev files, do you mean install the source code? You can always rerun

./configure

And configure your source to use python3. You cannot tell your source to use both at the same time, but you can switch between different python versions whenever you like using configure. However this will run bazel clean, which will destroy your bazel cache. To avoid that, you may just comment out the call to bazel_clean_and_fetch in configure script. In r0.12 branch it is here: https://github.com/tensorflow/tensorflow/blob/r0.12/configure#L146

This can work, however you may also see some issues due to reusing bazel cache.

Upvotes: 1

Related Questions