[ 
https://issues.apache.org/jira/browse/BEAM-1546?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tibor Kiss updated BEAM-1546:
-----------------------------
    Description: 
Python SDK currently supports Python-2.7 only.

apache_beam package's init uses named component attribute 
(sys.version_info.*major*) to bail if unsupported Python is used.
The named component based version was introduced in Python 2.7 thus
if one uses older Python version (e.g. 2.6) an AttributeError will be thrown:
{noformat}
Traceback (most recent call last):
  File "apache_beam/examples/complete/autocomplete_test.py", line 22, in 
<module>
    import apache_beam as beam
  File "/Users/tiborkiss/workspace/beam/sdks/python/apache_beam/__init__.py", 
line 69, in <module>
    if sys.version_info.major != 2:
AttributeError: 'tuple' object has no attribute 'major'
{noformat}

To fix this problem the {{sys.version_info.major}} should be replaced by 
{{sys.version_info[0]}}.


  was:
Python SDK currently supports Python2.7 only.

There are two shortcomings with the version check/enforcement:
1) apache_beam package's init uses named component attribute 
(sys.version_info.*major*) to bail if unsupported Python is used.
The named component based version was introduced in Python 2.7 thus
if one uses older Python version (e.g. 2.6) an AttributeError will be thrown:
{noformat}
Traceback (most recent call last):
  File "apache_beam/examples/complete/autocomplete_test.py", line 22, in 
<module>
    import apache_beam as beam
  File "/Users/tiborkiss/workspace/beam/sdks/python/apache_beam/__init__.py", 
line 69, in <module>
    if sys.version_info.major != 2:
AttributeError: 'tuple' object has no attribute 'major'
{noformat}

To fix this problem the {{sys.version_info.major}} should be replaced by 
{{sys.version_info[0]}}.

2) The Python interpreter & pip definition in pom.xml defines that {{python2}} 
& {{pip2}} should be used. Users with multiple Python interpreters installed 
might end up having python2 and pip2 pointing to their 2.6 installation. 
Calling out {{python2.7}} and {{pip2.7}} explicitly would help to resolve this 
problem.


> Specify exact version for Python in the SDK
> -------------------------------------------
>
>                 Key: BEAM-1546
>                 URL: https://issues.apache.org/jira/browse/BEAM-1546
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py
>    Affects Versions: 0.6.0
>            Reporter: Tibor Kiss
>            Assignee: Ahmet Altay
>            Priority: Trivial
>             Fix For: First stable release
>
>
> Python SDK currently supports Python-2.7 only.
> apache_beam package's init uses named component attribute 
> (sys.version_info.*major*) to bail if unsupported Python is used.
> The named component based version was introduced in Python 2.7 thus
> if one uses older Python version (e.g. 2.6) an AttributeError will be thrown:
> {noformat}
> Traceback (most recent call last):
>   File "apache_beam/examples/complete/autocomplete_test.py", line 22, in 
> <module>
>     import apache_beam as beam
>   File "/Users/tiborkiss/workspace/beam/sdks/python/apache_beam/__init__.py", 
> line 69, in <module>
>     if sys.version_info.major != 2:
> AttributeError: 'tuple' object has no attribute 'major'
> {noformat}
> To fix this problem the {{sys.version_info.major}} should be replaced by 
> {{sys.version_info[0]}}.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to