local conda build errors: No module named 'past'

Issue #502 resolved
Reimar Bauer created an issue

Adding in variants from internal_defaults
INFO:conda_build.variants:Adding in variants from internal_defaults
Traceback (most recent call last):
File "/home/user/miniconda3/lib/python3.7/site-packages/conda_build/jinja_context.py", line 130, in load_setup_py_data
permit_undefined_jinja=permit_undefined_jinja)
File "/home/user/miniconda3/lib/python3.7/site-packages/conda_build/_load_setup_py_data.py", line 93, in load_setup_py_data
exec(code, ns, ns)
File "/home/user/miniconda3/conda-bld/mss_1572943422575/work/setup.py", line 30, in <module>
from past.builtins import execfile
ModuleNotFoundError: No module named 'past'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/user/miniconda3/bin/conda-build", line 11, in <module>
sys.exit(main())
File "/home/user/miniconda3/lib/python3.7/site-packages/conda_build/cli/main_build.py", line 449, in main
execute(sys.argv[1:])
File "/home/user/miniconda3/lib/python3.7/site-packages/conda_build/cli/main_build.py", line 440, in execute
verify=args.verify, variants=args.variants)
File "/home/user/miniconda3/lib/python3.7/site-packages/conda_build/api.py", line 209, in build
notest=notest, need_source_download=need_source_download, variants=variants)
File "/home/user/miniconda3/lib/python3.7/site-packages/conda_build/build.py", line 2317, in build_tree
bypass_env_check=True)
File "/home/user/miniconda3/lib/python3.7/site-packages/conda_build/render.py", line 819, in render_recipe
allow_no_other_outputs=True, bypass_env_check=bypass_env_check)
File "/home/user/miniconda3/lib/python3.7/site-packages/conda_build/render.py", line 725, in distribute_variants
bypass_env_check=bypass_env_check)
File "/home/user/miniconda3/lib/python3.7/site-packages/conda_build/metadata.py", line 1011, in parse_until_resolved
bypass_env_check=bypass_env_check)
File "/home/user/miniconda3/lib/python3.7/site-packages/conda_build/metadata.py", line 940, in parse_again
bypass_env_check=bypass_env_check),
File "/home/user/miniconda3/lib/python3.7/site-packages/conda_build/metadata.py", line 1528, in _get_contents
rendered = template.render(environment=env)
File "/home/user/miniconda3/lib/python3.7/site-packages/jinja2/asyncsupport.py", line 76, in render
return original_render(self, *args, **kwargs)
File "/home/user/miniconda3/lib/python3.7/site-packages/jinja2/environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "/home/user/miniconda3/lib/python3.7/site-packages/jinja2/environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/user/miniconda3/lib/python3.7/site-packages/jinja2/_compat.py", line 37, in reraise
raise value.with_traceback(tb)
File "/home/user/PycharmProjects/mss/meta.yaml", line 1, in top-level template code
{% set version = load_setup_py_data().version %}
File "/home/user/miniconda3/lib/python3.7/site-packages/conda_build/jinja_context.py", line 142, in load_setup_py_data
"installed in root env. Import error was "{}"".format(e))
conda_build.exceptions.CondaBuildException: Could not render recipe - need modules installed in root env. Import error was "No module named 'past'"

Comments (9)

  1. Reimar Bauer reporter

    conda needs in the root environment future. This seems in conda-forge be installed

    conda install future

  2. Vaibhav Mehra

    @Reimar Bauer I have faced this same issue while installing mss into windows. In windows I tried to pass it by using conda powershell but it was of no use. After that @Shivashis Padhi suggested to pass the

    conda build .
    

    step(which was apparently giving this error) by “conda install mss” and then “conda remove mss --force” and it worked. In Ubuntu I have both python

    3.8 and python 2.7 and process didn’t give this error there. Also conda install future was not able to resolve this error in windows.

  3. Prayas Jain

    As far as I know, the issue currently is one of the dependency has “past” imported in it’s setup.py.

    Just a hunch but I think its the mss which is build installed from cloud (not the local one).

  4. Vaibhav Mehra

    I have just tried to clone and setup mss in a completely new directory with new conda environment and I replaced line 30 with

    from __future__ import exec
    

    and line 33 with

    exec(open('mslib/version.py').read())
    

    of setup.py even before creating the environment but the error remain same and the log is still pointing to line 30 of setup.py and saying no module named ‘past’

  5. Reimar Bauer reporter

    Hi,

    please look at #526 the main cause is that we have not synced back what is needed to build the recipe on conda-forge.

    If you clone or copy the mss-feedstock a build should be possible from the recipe dir. Because we use this also with the windows CIs. Please report if that works. If it doesn’t I have a hint that we need to change in the build process something.

    The documentation #524 will take care to show the easy part when we do the next stable.

    Meanwhile we wil use for intermediate descriptions the https://bitbucket.org/wxmetvis/mss/wiki/GSOC2020/Getting%20Started

    thx

    Reimar

  6. Vaibhav Mehra

    @Reimar Bauer I tried conda build . in recipe dir of mss-feedstock and got the following errors:

    No numpy version specified in conda_build_config.yaml.  Falling back to default numpy value of 1.11
    WARNING:conda_build.metadata:No numpy version specified in conda_build_config.yaml.  Falling back to default numpy value of 1.11
    Traceback (most recent call last):
      File "/home/vaibhav/anaconda3/bin/conda-build", line 11, in <module>
        sys.exit(main())
      File "/home/vaibhav/anaconda3/lib/python3.7/site-packages/conda_build/cli/main_build.py", line 445, in main
        execute(sys.argv[1:])
      File "/home/vaibhav/anaconda3/lib/python3.7/site-packages/conda_build/cli/main_build.py", line 436, in execute
        verify=args.verify, variants=args.variants)
      File "/home/vaibhav/anaconda3/lib/python3.7/site-packages/conda_build/api.py", line 209, in build
        notest=notest, need_source_download=need_source_download, variants=variants)
      File "/home/vaibhav/anaconda3/lib/python3.7/site-packages/conda_build/build.py", line 2321, in build_tree
        bypass_env_check=True)
      File "/home/vaibhav/anaconda3/lib/python3.7/site-packages/conda_build/render.py", line 785, in render_recipe
        m = MetaData(recipe_dir, config=config)
      File "/home/vaibhav/anaconda3/lib/python3.7/site-packages/conda_build/metadata.py", line 862, in __init__
        self.parse_again(permit_undefined_jinja=True, allow_no_other_outputs=True)
      File "/home/vaibhav/anaconda3/lib/python3.7/site-packages/conda_build/metadata.py", line 939, in parse_again
        bypass_env_check=bypass_env_check),
      File "/home/vaibhav/anaconda3/lib/python3.7/site-packages/conda_build/metadata.py", line 1505, in _get_contents
        skip_build_id=skip_build_id, variant=variant))
      File "/home/vaibhav/anaconda3/lib/python3.7/site-packages/conda_build/jinja_context.py", line 495, in context_processor
        ctx = get_environ(m=initial_metadata, for_env=False, skip_build_id=skip_build_id,escape_backslash=True, variant=variant)
    NameError: name 'get_environ' is not definedI
    

    I guess some of the above errors are also the part of log shared by you at the starting of this issue.

  7. Log in to comment