@@ -46,16 +46,14 @@ set -e
46
46
arch_list_x86_64=( numpy-1.18.5-cp38-cp38-macosx_11_0_x86_64.whl
47
47
grpcio-1.33.2-cp38-cp38-macosx_11_0_x86_64.whl
48
48
h5py-2.10.0-cp38-cp38-macosx_11_0_x86_64.whl
49
- scipy-1.5.4-cp38-cp38-macosx_11_0_x86_64.whl
50
- tensorflow_addons-0.11.2+mlcompute-cp38-cp38-macosx_11_0_x86_64.whl )
49
+ scipy-1.5.4-cp38-cp38-macosx_11_0_x86_64.whl )
51
50
52
51
arch_list_arm64=( numpy-1.18.5-cp38-cp38-macosx_11_0_arm64.whl
53
52
grpcio-1.33.2-cp38-cp38-macosx_11_0_arm64.whl
54
- h5py-2.10.0-cp38-cp38-macosx_11_0_arm64.whl
55
- tensorflow_addons-0.11.2+mlcompute-cp38-cp38-macosx_11_0_arm64.whl )
53
+ h5py-2.10.0-cp38-cp38-macosx_11_0_arm64.whl )
56
54
57
55
58
- tensorflow_version=0.1a1
56
+ tensorflow_version=0.1a2
59
57
60
58
61
59
function usage() {
@@ -183,7 +181,7 @@ tf_install_message=""
183
181
184
182
# Now, see if a virtual environment was given as an argument.
185
183
if [[ -e $virtual_env ]] ; then
186
- if [[ ! -d " $virtual_env " ]] || [[ ! -e " $virtual_env /bin/activate " ]] ; then
184
+ if [[ ! -d " $virtual_env " ]] || [[ ! -e " $virtual_env /bin/python " ]] ; then
187
185
error_exit " $virtual_env does not seem to be a virtual environment. Please specify a new directory or an existing Python 3.8 virtual environment. "
188
186
fi
189
187
create_venv=0
@@ -307,7 +305,11 @@ if [[ $create_venv == 1 ]] ; then
307
305
" $python_bin " -m venv " $virtual_env "
308
306
fi
309
307
310
- . " $virtual_env /bin/activate"
308
+ # Test for existence here -- If it's a conda environment that's already activated, this allows the script to still work.
309
+ if [[ -e " $virtual_env /bin/activate" ]] ; then
310
+ . " $virtual_env /bin/activate"
311
+ fi
312
+
311
313
python_bin=" $virtual_env /bin/python3"
312
314
313
315
export MACOSX_DEPLOYMENT_TARGET=11.0
319
321
320
322
# Upgrade pip and base packages
321
323
echo " >> Installing and upgrading base packages."
322
- " $python_bin " -m pip install --force pip==20.2.4 wheel setuptools cached-property six
324
+ " $python_bin " -m pip install --force pip==20.2.4 wheel setuptools cached-property six packaging
323
325
324
326
echo " >> Installing bundled binary dependencies."
325
327
326
328
# Note: As soon python packaging supports macOS 11.0 in full, we can remove the -t hackery.
327
329
for f in ${packages[@]} ; do
328
- " $python_bin " -m pip install --upgrade -t " $VIRTUAL_ENV /lib/python3.8/site-packages/" --no-dependencies --force " $package_dir /$f "
330
+ " $python_bin " -m pip install --upgrade -t " $virtual_env /lib/python3.8/site-packages/" --no-dependencies --force " $package_dir /$f "
329
331
done
330
332
331
333
# Manually install all the other dependencies.
332
334
echo " >> Installing dependencies."
333
335
" $python_bin " -m pip install absl-py astunparse flatbuffers gast google_pasta keras_preprocessing opt_einsum protobuf tensorflow_estimator termcolor typing_extensions wrapt wheel tensorboard typeguard
334
336
335
- # Install some convenience tools
337
+ # Install some convenience tools.
336
338
" $python_bin " -m pip install ipython
337
339
338
- # Install the tensorflow wheel itself
339
- " $python_bin " -m pip install --upgrade --force -t " $VIRTUAL_ENV /lib/python3.8/site-packages/" --no-dependencies " $package_dir " /tensorflow_macos* -cp38-cp38-macosx_11_0_$arch .whl
340
+ # Install the tensorflow wheel itself.
341
+ " $python_bin " -m pip install --upgrade --force -t " $virtual_env /lib/python3.8/site-packages/" --no-dependencies " $package_dir " /tensorflow_macos* -cp38-cp38-macosx_11_0_$arch .whl
342
+
343
+ # Install the tensorflow-addons wheel.
344
+ " $python_bin " -m pip install --upgrade --force -t " $virtual_env /lib/python3.8/site-packages/" --no-dependencies " $package_dir " /tensorflow_addons_macos* -cp38-cp38-macosx_11_0_$arch .whl
340
345
341
346
# Finally, upgrade pip to give the developers the correct version.
342
347
" $python_bin " -m pip install --upgrade pip
@@ -345,10 +350,13 @@ echo '##########################################################################
345
350
echo
346
351
echo " TensorFlow and TensorFlow Addons with ML Compute for macOS 11.0 successfully installed."
347
352
echo
348
- echo " To begin, activate the virtual environment:"
349
- echo
350
- echo " . \" $virtual_env /bin/activate\" "
351
- echo
353
+
354
+ if [[ -e " $virtual_env /bin/activate" ]] ; then
355
+ echo " To begin, activate the virtual environment:"
356
+ echo
357
+ echo " . \" $virtual_env /bin/activate\" "
358
+ echo
359
+ fi
352
360
353
361
354
362
0 commit comments