intel-analytics / analytics-zoo

Distributed Tensorflow, Keras and PyTorch on Apache Spark/Flink & Ray
https://analytics-zoo.readthedocs.io/
Apache License 2.0
16 stars 3 forks source link

Known env issues on macOS #825

Open qiyuangong opened 4 years ago

qiyuangong commented 4 years ago

Ray 0.7.2 on macOS

MAC/dist/apps/ray/parameter_server/sharded_parameter_server.py", line 33, in <module>
    import ray
  File "/Users/arda/anaconda3/envs/py36pip/lib/python3.6/site-packages/ray/__init__.py", line 28, in <module>
    import pyarrow  # noqa: F401
  File "/Users/arda/anaconda3/envs/py36pip/lib/python3.6/site-packages/ray/pyarrow_files/pyarrow/__init__.py", line 49, in <module>
    from pyarrow.lib import cpu_count, set_cpu_count
ImportError: dlopen(/Users/arda/anaconda3/envs/py36pip/lib/python3.6/site-packages/ray/pyarrow_files/pyarrow/lib.cpython-36m-darwin.so, 2): Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
  Referenced from: /Users/arda/anaconda3/envs/py36pip/lib/python3.6/site-packages/ray/pyarrow_files/pyarrow/libarrow.14.dylib
  Reason: image not found 

Reason: https://github.com/deephyper/deephyper/issues/20 Solution: downgrade to openssl1.0 (a little dangerous because other lib may depend on openssl)

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/64555220bfbf4a25598523c2e4d3a232560eaad7/Formula/openssl.rb -f
qiyuangong commented 4 years ago

OpenCV

  File "/Users/arda/anaconda3/envs/py37pip/lib/python3.7/site-packages/cv2/__init__.py", line 5, in <module>
    from .cv2 import *
ImportError: dlopen(/Users/arda/anaconda3/envs/py37pip/lib/python3.7/site-packages/cv2/cv2.cpython-37m-darwin.so, 2): Symbol not found: _inflateValidate
  Referenced from: /Users/arda/anaconda3/envs/py37pip/lib/python3.7/site-packages/cv2/.dylibs/libpng16.16.dylib (which was built for Mac OS X 10.13)
  Expected in: /usr/lib/libz.1.dylib
 in /Users/arda/anaconda3/envs/py37pip/lib/python3.7/site-packages/cv2/.dylibs/libpng16.16.dylib

Reason: macOS version below opencv pip required version. https://stackoverflow.com/questions/60254766/opencv-giving-an-error-whenever-import-cv2-is-used Solution: Upgrade macOS to 10.14 or downgrade opencv

pip install opencv-python==4.1.0.25
qiyuangong commented 4 years ago

macOS sed -i problem

Reason: macOS sed is BSD version, which is different GNU sed used on linux. https://unix.stackexchange.com/questions/13711/differences-between-sed-on-mac-osx-and-other-standard-sed

Solution: Install gnu sed and set path, or change all sed command until not erros.

# install gnu sed
brew install coreutils gnu-sed
# set path for gnu sed
export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
glorysdj commented 4 years ago

these should be FAQ in doc for analytics-zoo on MACOS