Im running into some issues with running my steps ...
# ask-metaflow
e
Im running into some issues with running my steps on a custom container in AWS. The fundamental issue is the python versions within the image. I have
python2.7
,
python3
and
python3.5
installed - but I am running into issues trying to
import metaflow
using python3.5 .
Copy code
root@715a805dbc61:/# python3
Python 3.5.2 (default, Nov 12 2018, 13:43:14) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import metaflow
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/metaflow/__init__.py", line 54, in <module>
    from metaflow.extension_support import (
  File "/usr/local/lib/python3.5/dist-packages/metaflow/extension_support.py", line 783, in <module>
    _all_packages, _pkgs_per_extension_point = _get_extension_packages()
  File "/usr/local/lib/python3.5/dist-packages/metaflow/extension_support.py", line 333, in _get_extension_packages
    all_paths = set(extensions_module.__path__)
UnboundLocalError: local variable 'extensions_module' referenced before assignment
I get this despite having
metaflow
installed (see comments). Any suggestions on what i might be doing wrong here?
Copy code
python3 -m pip install --extra-index-url <https://pypi.org/simple> metaflow
DEPRECATION: Python 3.5 reached the end of its life on September 13th, 2020. Please upgrade your Python as Python 3.5 is no longer maintained. pip 21.0 will drop support for Python 3.5 in January 2021. pip 21.0 will remove support for this functionality.
Looking in indexes: <https://dl.cloudsmith.io/yxgPVntHlnxNJQKP/outrider/pipper/python/simple/>, <https://pypi.org/simple>
Requirement already satisfied: metaflow in /usr/local/lib/python3.5/dist-packages (2.7.19)
Requirement already satisfied: pylint in /usr/local/lib/python3.5/dist-packages (from metaflow) (2.6.2)
Requirement already satisfied: requests in /usr/local/lib/python3.5/dist-packages (from metaflow) (2.25.1)
Requirement already satisfied: boto3 in /usr/local/lib/python3.5/dist-packages (from metaflow) (1.16.63)
Requirement already satisfied: botocore<1.20.0,>=1.19.63 in /usr/local/lib/python3.5/dist-packages (from boto3->metaflow) (1.19.63)
Requirement already satisfied: s3transfer<0.4.0,>=0.3.0 in /usr/local/lib/python3.5/dist-packages (from boto3->metaflow) (0.3.7)
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /usr/local/lib/python3.5/dist-packages (from boto3->metaflow) (0.10.0)
Requirement already satisfied: urllib3<1.27,>=1.25.4 in /usr/local/lib/python3.5/dist-packages (from botocore<1.20.0,>=1.19.63->boto3->metaflow) (1.26.9)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /usr/local/lib/python3.5/dist-packages (from botocore<1.20.0,>=1.19.63->boto3->metaflow) (2.8.2)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.5/dist-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.20.0,>=1.19.63->boto3->metaflow) (1.16.0)
Requirement already satisfied: astroid<2.5,>=2.4.0 in /usr/local/lib/python3.5/dist-packages (from pylint->metaflow) (2.4.2)
Requirement already satisfied: isort<6,>=4.2.5 in /usr/local/lib/python3.5/dist-packages (from pylint->metaflow) (4.3.21)
Requirement already satisfied: toml>=0.7.1 in /usr/local/lib/python3.5/dist-packages (from pylint->metaflow) (0.10.2)
Requirement already satisfied: mccabe<0.7,>=0.6 in /usr/local/lib/python3.5/dist-packages (from pylint->metaflow) (0.6.1)
Requirement already satisfied: wrapt~=1.11 in /usr/local/lib/python3.5/dist-packages (from astroid<2.5,>=2.4.0->pylint->metaflow) (1.14.1)
Requirement already satisfied: typed-ast<1.5,>=1.4.0 in /usr/local/lib/python3.5/dist-packages (from astroid<2.5,>=2.4.0->pylint->metaflow) (1.4.3)
Requirement already satisfied: lazy-object-proxy==1.4.* in /usr/local/lib/python3.5/dist-packages (from astroid<2.5,>=2.4.0->pylint->metaflow) (1.4.3)
Requirement already satisfied: chardet<5,>=3.0.2 in /usr/local/lib/python3.5/dist-packages (from requests->metaflow) (4.0.0)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.5/dist-packages (from requests->metaflow) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.5/dist-packages (from requests->metaflow) (2021.10.8)
a
@dry-beach-38304 can you take a look?
d
hun, what do you know. this one has been lurking for a while. Iโ€™ll fix it shortly. If you want to unblock yourself, the fix is very simple: on line 319 of the
extension_support.py
file, remove 4 spaces (to align the return with the if as opposed to being inside the if).
sorry about that. We do test on 3.5 but this particular configuration is not tested (ie: we test to make sure extensions work but not the exception case ๐Ÿ˜ž ).
at any rate, that small tweak should get it to work for you. Iโ€™ll push a fix today or tomorrow.
e
woo thank you !! ๐Ÿ™‚
d
well, sorry for not coding it properly in the first place. itโ€™s a dump typo-like bug ๐Ÿ˜ž
e
no worries im glad im not just the crazy guy asking everyone to solve my problems in the channel ๐Ÿ˜…
did this get updated? If so, now i am seeing a similar error:
Copy code
>>> import metaflow
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/metaflow/__init__.py", line 54, in <module>
    from metaflow.extension_support import (
  File "/usr/local/lib/python3.5/dist-packages/metaflow/extension_support/__init__.py", line 786, in <module>
    _all_packages, _pkgs_per_extension_point = _get_extension_packages()
  File "/usr/local/lib/python3.5/dist-packages/metaflow/extension_support/__init__.py", line 335, in _get_extension_packages
    all_paths = set(extensions_module.__path__)
UnboundLocalError: local variable 'extensions_module' referenced before assignment
this time the solution (i think) was to remove the first 4 characters from line
321
of
/usr/local/lib/python3.5/dist-packages/metaflow/extension_support/__init__.py
d
yes
e
is this behavior expected ?
d
itโ€™s a bug with mf and python 3.5
if you use python 3.6+, itโ€™s not there.
๐Ÿ‘ 1
e
unfortunately im locked to 3.5 ๐Ÿ˜•
d
we will fix it shortly
๐Ÿ™Œ 1
thankyou 1
but the remove 4 chars will gete you unstuck
โœ… 1