tensorflow / gnn

TensorFlow GNN is a library to build Graph Neural Networks on the TensorFlow platform.
Apache License 2.0
1.34k stars 174 forks source link

Normal Installation Fails #22

Closed Jerry-Master closed 2 years ago

Jerry-Master commented 2 years ago

I am trying to install tensorflow_gnn in my own environment on MacOS Monterey. My Python version is 3.9 and I have Bazel, tensorflow and graphviz installed. The errors are the following:

Building wheels for collected packages: tensorflow-gnn, pygraphviz
  Building wheel for tensorflow-gnn (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [63 lines of output]
      running bdist_wheel
      running build
      running bazel_build
      Loading:
      Loading: 0 packages loaded
      Loading: 0 packages loaded
      Loading: 0 packages loaded
      Loading: 0 packages loaded
      Loading: 0 packages loaded
      Loading: 0 packages loaded
      INFO: Repository org_tensorflow instantiated at:
        /Users/joseperezcano/Desktop/IDAO_2022/tensorflow_gnn/WORKSPACE:7:9: in <toplevel>
        /Users/joseperezcano/Desktop/IDAO_2022/tensorflow_gnn/package/tfdep.bzl:7:17: in tf_setup
      Repository rule http_archive defined at:
        /private/var/tmp/_bazel_joseperezcano/9bb9c29a27614ceb3a61050e6f96bc44/external/bazel_tools/tools/build_defs/repo/http.bzl:364:31: in <toplevel>
      WARNING: Download from https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.6.0.tar.gz failed: class java.io.IOException Proxy address localhost:8080 is not a valid URL
      ERROR: An error occurred during the fetch of repository 'org_tensorflow':
         Traceback (most recent call last):
          File "/private/var/tmp/_bazel_joseperezcano/9bb9c29a27614ceb3a61050e6f96bc44/external/bazel_tools/tools/build_defs/repo/http.bzl", line 111, column 45, in _http_archive_impl
                  download_info = ctx.download_and_extract(
      Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.6.0.tar.gz] to /private/var/tmp/_bazel_joseperezcano/9bb9c29a27614ceb3a61050e6f96bc44/external/org_tensorflow/temp10782059563076960071/v2.6.0.tar.gz: Proxy address localhost:8080 is not a valid URL
      ERROR: /Users/joseperezcano/Desktop/IDAO_2022/tensorflow_gnn/WORKSPACE:7:9: fetching http_archive rule //external:org_tensorflow: Traceback (most recent call last):
          File "/private/var/tmp/_bazel_joseperezcano/9bb9c29a27614ceb3a61050e6f96bc44/external/bazel_tools/tools/build_defs/repo/http.bzl", line 111, column 45, in _http_archive_impl
                  download_info = ctx.download_and_extract(
      Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.6.0.tar.gz] to /private/var/tmp/_bazel_joseperezcano/9bb9c29a27614ceb3a61050e6f96bc44/external/org_tensorflow/temp10782059563076960071/v2.6.0.tar.gz: Proxy address localhost:8080 is not a valid URL
      ERROR: no such package '@org_tensorflow//tensorflow': java.io.IOException: Error downloading [https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.6.0.tar.gz] to /private/var/tmp/_bazel_joseperezcano/9bb9c29a27614ceb3a61050e6f96bc44/external/org_tensorflow/temp10782059563076960071/v2.6.0.tar.gz: Proxy address localhost:8080 is not a valid URL
      INFO: Elapsed time: 12,913s
      INFO: 0 processes.
      FAILED: Build did NOT complete successfully (0 packages loaded)
      ERROR: Build failed. Not running target
      FAILED: Build did NOT complete successfully (0 packages loaded)
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/Users/joseperezcano/Desktop/IDAO_2022/tensorflow_gnn/setup.py", line 152, in <module>
          setup(
        File "/Users/joseperezcano/Desktop/IDAO_2022/crystal/lib/python3.9/site-packages/setuptools/__init__.py", line 155, in setup
          return distutils.core.setup(**attrs)
        File "/Users/joseperezcano/Desktop/IDAO_2022/crystal/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 148, in setup
          return run_commands(dist)
        File "/Users/joseperezcano/Desktop/IDAO_2022/crystal/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
          dist.run_commands()
        File "/Users/joseperezcano/Desktop/IDAO_2022/crystal/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
          self.run_command(cmd)
        File "/Users/joseperezcano/Desktop/IDAO_2022/crystal/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/Users/joseperezcano/Desktop/IDAO_2022/crystal/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 299, in run
          self.run_command('build')
        File "/Users/joseperezcano/Desktop/IDAO_2022/crystal/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/Users/joseperezcano/Desktop/IDAO_2022/crystal/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/Users/joseperezcano/Desktop/IDAO_2022/crystal/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 135, in run
          self.run_command(cmd_name)
        File "/Users/joseperezcano/Desktop/IDAO_2022/crystal/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/Users/joseperezcano/Desktop/IDAO_2022/crystal/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/Users/joseperezcano/Desktop/IDAO_2022/tensorflow_gnn/setup.py", line 86, in run
          subprocess.check_call(
        File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 373, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/usr/local/bin/bazel', 'run', '-c', 'opt', '--experimental_repo_remote_exec', '--macos_minimum_os=10.9', '//package:move_generated_files']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for tensorflow-gnn
  Running setup.py clean for tensorflow-gnn
  Building wheel for pygraphviz (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [48 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-12-x86_64-3.9
      creating build/lib.macosx-12-x86_64-3.9/pygraphviz
      copying pygraphviz/scraper.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz
      copying pygraphviz/graphviz.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz
      copying pygraphviz/__init__.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz
      copying pygraphviz/agraph.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz
      copying pygraphviz/testing.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz
      creating build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_unicode.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_scraper.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_readwrite.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_string.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/__init__.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_html.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_node_attributes.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_drawing.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_repr_mimebundle.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_subgraph.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_close.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_edge_attributes.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_clear.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_layout.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_attribute_defaults.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_graph.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      running egg_info
      warning: no files found matching '*.png' under directory 'doc'
      warning: no files found matching '*.txt' under directory 'doc'
      warning: no files found matching '*.css' under directory 'doc'
      warning: no previously-included files matching '*~' found anywhere in distribution
      warning: no previously-included files matching '*.pyc' found anywhere in distribution
      warning: no previously-included files matching '.svn' found anywhere in distribution
      no previously-included directories found matching 'doc/build'
      writing manifest file 'pygraphviz.egg-info/SOURCES.txt'
      copying pygraphviz/graphviz.i -> build/lib.macosx-12-x86_64-3.9/pygraphviz
      copying pygraphviz/graphviz_wrap.c -> build/lib.macosx-12-x86_64-3.9/pygraphviz
      running build_ext
      creating build/temp.macosx-12-x86_64-3.9
      creating build/temp.macosx-12-x86_64-3.9/pygraphviz
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I/Users/joseperezcano/Desktop/IDAO_2022/crystal/include -I/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c pygraphviz/graphviz_wrap.c -o build/temp.macosx-12-x86_64-3.9/pygraphviz/graphviz_wrap.o
      pygraphviz/graphviz_wrap.c:2711:10: fatal error: 'graphviz/cgraph.h' file not found
      #include "graphviz/cgraph.h"
               ^~~~~~~~~~~~~~~~~~~
      1 error generated.
      error: command '/usr/local/opt/llvm/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pygraphviz
  Running setup.py clean for pygraphviz
Failed to build tensorflow-gnn pygraphviz
Installing collected packages: pygraphviz, pydot, proto-plus, pillow, packaging, orjson, numpy, networkx, mock, kiwisolver, httplib2, googleapis-common-protos, google-crc32c, fonttools, fasteners, fastavro, dill, cycler, cachetools, scipy, pyarrow, oauth2client, matplotlib, libcst, hdfs, grpcio-gcp, google-resumable-media, google-auth, grpc-google-iam-v1, google-apitools, google-api-core, apache-beam, google-cloud-core, tensorflow-cpu, google-cloud-vision, google-cloud-videointelligence, google-cloud-spanner, google-cloud-recommendations-ai, google-cloud-pubsub, google-cloud-language, google-cloud-dlp, google-cloud-datastore, google-cloud-bigtable, google-cloud-bigquery-storage, google-cloud-bigquery, tensorflow-gnn
  Running setup.py install for pygraphviz ... error
  error: subprocess-exited-with-error

  × Running setup.py install for pygraphviz did not run successfully.
  │ exit code: 1
  ╰─> [50 lines of output]
      running install
      /Users/joseperezcano/Desktop/IDAO_2022/crystal/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.macosx-12-x86_64-3.9
      creating build/lib.macosx-12-x86_64-3.9/pygraphviz
      copying pygraphviz/scraper.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz
      copying pygraphviz/graphviz.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz
      copying pygraphviz/__init__.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz
      copying pygraphviz/agraph.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz
      copying pygraphviz/testing.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz
      creating build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_unicode.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_scraper.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_readwrite.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_string.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/__init__.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_html.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_node_attributes.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_drawing.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_repr_mimebundle.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_subgraph.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_close.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_edge_attributes.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_clear.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_layout.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_attribute_defaults.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      copying pygraphviz/tests/test_graph.py -> build/lib.macosx-12-x86_64-3.9/pygraphviz/tests
      running egg_info
      warning: no files found matching '*.png' under directory 'doc'
      warning: no files found matching '*.txt' under directory 'doc'
      warning: no files found matching '*.css' under directory 'doc'
      warning: no previously-included files matching '*~' found anywhere in distribution
      warning: no previously-included files matching '*.pyc' found anywhere in distribution
      warning: no previously-included files matching '.svn' found anywhere in distribution
      no previously-included directories found matching 'doc/build'
      writing manifest file 'pygraphviz.egg-info/SOURCES.txt'
      copying pygraphviz/graphviz.i -> build/lib.macosx-12-x86_64-3.9/pygraphviz
      copying pygraphviz/graphviz_wrap.c -> build/lib.macosx-12-x86_64-3.9/pygraphviz
      running build_ext
      creating build/temp.macosx-12-x86_64-3.9
      creating build/temp.macosx-12-x86_64-3.9/pygraphviz
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I/Users/joseperezcano/Desktop/IDAO_2022/crystal/include -I/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c pygraphviz/graphviz_wrap.c -o build/temp.macosx-12-x86_64-3.9/pygraphviz/graphviz_wrap.o
      pygraphviz/graphviz_wrap.c:2711:10: fatal error: 'graphviz/cgraph.h' file not found
      #include "graphviz/cgraph.h"
               ^~~~~~~~~~~~~~~~~~~
      1 error generated.
      error: command '/usr/local/opt/llvm/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pygraphviz

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

When trying to fix the pygraphviz error I also followed this thread and this one. But the errors are still the same.

I know there was an issue in #7 with one line in package/BUILD but that line is no longer in the file in the new version so that is not the problem. Please, any help is appreciated.

poladz commented 2 years ago

Hey! Have you solved the problem?

Thanks.

Jerry-Master commented 2 years ago

No

Levy-Naibei commented 2 years ago

facing the same problem with lxml installation from requirements.tx

gamingflexer commented 2 years ago

Same issue for spacy 2.2.4

    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: legacy-install-failure

  × Encountered error while trying to install package.
  ╰─> blis

  note: This is an issue with the package mentioned above, not pip.
  hint: See above for output from the failure.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: su

zeke-john commented 2 years ago

has anyone found a solution

cjoverbay commented 2 years ago

I have an Apple M1 Macbook Air I was able to get past the pygraphviz installation problem with:

brew install graphviz
brew install graphviz-devel

Then (replacing with your graphviz version (brew info graphviz))

export GRAPHVIZ_DIR="/usr/local/Cellar/graphviz/<VERSION>"
pip install pygraphviz --global-option=build_ext --global-option="-I$GRAPHVIZ_DIR/include" --global-option="-L$GRAPHVIZ_DIR/lib"

I was also able to get past the tensorflow error, by changing the requirement in setup.py from "tensorflow-cpu" to "tensorflow-macos"

Then, I had an issue with bazel builds:


  DEBUG: /private/var/tmp/_bazel_cjoverbay/a57bf63f72917c0265cc0fb09ed42f76/external/tf_runtime/third_party/cuda/dependencies.bzl:51:10: The following command will download NVIDIA proprietary software. By using the software you agree to comply with the terms of the license agreement that accompanies the software. If you do not agree to the terms of the license agreement, do not use the software.
      Analyzing: target //package:move_generated_files (0 packages loaded, 0 targets configured)
      ERROR: /private/var/tmp/_bazel_cjoverbay/a57bf63f72917c0265cc0fb09ed42f76/external/local_config_cc/BUILD:48:19: in cc_toolchain_suite rule @local_config_cc//:toolchain: cc_toolchain_suite '@local_config_cc//:toolchain' does not contain a toolchain for cpu 'darwin_arm64'
      ERROR: /private/var/tmp/_bazel_cjoverbay/a57bf63f72917c0265cc0fb09ed42f76/external/local_config_cc/BUILD:48:19: Analysis of target '@local_config_cc//:toolchain' failed
      ERROR: /private/var/tmp/_bazel_cjoverbay/a57bf63f72917c0265cc0fb09ed42f76/external/com_google_protobuf/BUILD:412:10: errors encountered resolving select() keys for @com_google_protobuf//:protoc
      ERROR: Analysis of target '//package:move_generated_files' failed; build aborted:
      INFO: Elapsed time: 0.075s
      INFO: 0 processes.
      FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
      ERROR: Build failed. Not running target

Which I resolved with the following thread (needed to add darwin_amd64 to toolchain) https://github.com/bazelbuild/bazel/issues/13514

Now I am blocked on other bazel related issue (segmentation fault) Investigating here. https://github.com/protocolbuffers/protobuf/issues/8884

mihirparadkar commented 2 years ago

Hi, please try installing 0.2.0 via pip install tensorflow_gnn and open another issue if that doesn't work for you.