4

I keep getting an error like:

Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-dg6i9xjw/apache-beam/

I tried installing easy_install and other stuff, still getting the same error...

===================================================

This is my complete output:

sudo -H pip install apache-beam

Collecting apache-beam

Downloading apache-beam-2.1.1.zip (859kB)

100% |████████████████████████████████| 860kB 829kB/s 

Complete output from command python setup.py egg_info:

Error compiling Cython file:
------------------------------------------------------------
...

    For performance reasons, doesn't actually impose an ordering
    on unequal values (always returning 1).
    """
    if type(left) is not type(right):
      return cmp(type(left), type(right))
               ^
------------------------------------------------------------

apache_beam/utils/windowed_value.py:83:16: undeclared name not builtin: cmp
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/tmp/pip-build-dg6i9xjw/apache-beam/setup.py", line 172, in <module>
    'apache_beam/utils/windowed_value.py',
  File "/Users/hyuns003/anaconda/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 934, in cythonize
    cythonize_one(*args)
  File "/Users/hyuns003/anaconda/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1056, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: apache_beam/utils/windowed_value.py
Compiling apache_beam/coders/stream.pyx because it changed.
Compiling apache_beam/runners/worker/statesampler.pyx because it changed.
Compiling apache_beam/coders/coder_impl.py because it changed.
Compiling apache_beam/metrics/execution.py because it changed.
Compiling apache_beam/runners/common.py because it changed.
Compiling apache_beam/runners/worker/logger.py because it changed.
Compiling apache_beam/runners/worker/opcounters.py because it changed.
Compiling apache_beam/runners/worker/operations.py because it changed.
Compiling apache_beam/transforms/cy_combiners.py because it changed.
Compiling apache_beam/utils/counters.py because it changed.
Compiling apache_beam/utils/windowed_value.py because it changed.
[ 1/11] Cythonizing apache_beam/coders/coder_impl.py
[ 2/11] Cythonizing apache_beam/coders/stream.pyx
[ 3/11] Cythonizing apache_beam/metrics/execution.py
[ 4/11] Cythonizing apache_beam/runners/common.py
[ 5/11] Cythonizing apache_beam/runners/worker/logger.py
[ 6/11] Cythonizing apache_beam/runners/worker/opcounters.py
[ 7/11] Cythonizing apache_beam/runners/worker/operations.py
[ 8/11] Cythonizing apache_beam/runners/worker/statesampler.pyx
[ 9/11] Cythonizing apache_beam/transforms/cy_combiners.py
[10/11] Cythonizing apache_beam/utils/counters.py
[11/11] Cythonizing apache_beam/utils/windowed_value.py

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-dg6i9xjw/apache-beam/

=====================================================

Another update:

Used

sudo pip2 install apache-beam

and seemed like it worked in Terminal. However, when I do this in Jupyter Notebook:

import apache_beam as beam

Then I get this error msg...

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-6-b42270dcd395> in <module>()
----> 1 import apache_beam as beam

ModuleNotFoundError: No module named 'apache_beam'
Clara Shin
  • 41
  • 3
  • What is the complete output leading up to the error? – jwodder Oct 02 '17 at 19:35
  • according to this post, https://stackoverflow.com/a/36025294/8222554, error code 1 is an `Operation not permiited` error. So the install might be trying to write to some system or admin location your user does not have access to. I am not very familiar with OS X, but on linux you can do `pip install --user` to only install for that user – stephen Oct 02 '17 at 20:00
  • @jwodder Edited the post to add the complete output :) – Clara Shin Oct 03 '17 at 01:10

1 Answers1

6

The apache-beam package is only compatible with Python 2.7, yet you are trying to install it in Python 3.6. Don't do that.

jwodder
  • 54,758
  • 12
  • 108
  • 124
  • ^ This. What's confusing is that on PyPI, they have `apache-beam` releases installable under Python 3 up until 2.2.0, which seems like a mistake. When I install and import it under 3, I receive `RuntimeError: The Apache Beam SDK for Python is supported only on Python 2.7. It is not supported on Python [sys.version_info(major=3, minor=6, micro=4, releaselevel='final', serial=0)].` – Taylor D. Edmiston Apr 05 '18 at 21:49