Iris: Cannot install iris for Python3.6

Created on 6 Apr 2017  Â·  7Comments  Â·  Source: SciTools/iris

Hi,

I cannot install Iris in my python 3.6 environment because of it's dependency on pyke which is only available for up to python 3.5. Is there a workaround for this issue?
Here's a printout of the error after I installed poke 1.1.1:

running build_py
/opt/local/bin/python tools/generate_std_names.py etc/cf-standard-name-table.xml build/lib/iris/std_names.py
Traceback (most recent call last):
File "setup.py", line 229, in
'clean_source': CleanSource},
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/command/install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 161, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 147, in call_command
self.run_command(cmdname)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/command/install_lib.py", line 11, in run
self.build()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/install_lib.py", line 105, in build
self.run_command('build_py')
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 180, in run
MakePykeRules._pyke_rule_compile()
File "setup.py", line 132, in _pyke_rule_compile
from pyke import knowledge_engine
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyke/knowledge_engine.py", line 45, in
from pyke import contexts
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyke/contexts.py", line 178
print "%s: %s" % (var_name, repr(self.lookup_data(var_name, True)))
^
SyntaxError: invalid syntax

High Bug

All 7 comments

...it's dependency on pyke which is only available for up to python 3.5...

Where are you fetching pyke from? The highest dependency in the conda scitools channel is 3.5, your right. However, you can try using pyke from the conda-forge channel for python3.6. I assume you are using conda: conda install pyke --channel conda-forge (conda-forge/pyke-feedstock/pull/3)

Hi,

I downloaded pyke form the the homepage: http://pyke.sourceforge.net.

I’m on a mac using Macport and pip, not conda. I recently upgraded to Python3.6 from python2.7 because I wanted to learn python3.

I have many other modules working well in python3.6 so I would not like to downgrade. I’m doing some work in meteorology and came across IRIS and wanted to give it a try.

Thanks,

/M

From: Carwyn Pelley notifications@github.com
Reply-To: SciTools/iris reply@reply.github.com
Date: Friday, 7 April 2017 at 09:40
To: SciTools/iris iris@noreply.github.com
Cc: Marston shejo284@gmail.com, Author author@noreply.github.com
Subject: Re: [SciTools/iris] Cannot install iris for Python3.6 (#2481)

...it's dependency on pyke which is only available for up to python 3.5...

Where are you fetching pyke from? The highest dependency in the conda scitools channel is 3.5, your right. However, you can try using pyke from the conda-forge channel for python3.6. I assume you are using conda: conda install pyke --channel conda-forge (conda-forge/pyke-feedstock#3)

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Pyke is one of those weird/old projects that is not single-source. Make sure you install from the pyke3 file, not the plain pyke file.

Looking at your traceback, it appears you have the pyke for python2.7.

You should download pyke3-1.1.1.zip from here:
https://sourceforge.net/projects/pyke/files/pyke/1.1.1/

I have checked the source of pyke3 above and it doesn't have the python2.7 code that appears in your stack trace so that seems to confirm my suspicion.

Ok. Thanks for the correction on the pike version. I've removed and installed the correct version per your advice. After installing biggie and cf_units, my latest attempt to install iris-master:

sudo -H /opt/local/bin/python setup.py install
/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/dist.py:334: UserWarning: Normalizing '1.12.0-DEV' to '1.12.0.dev0'
normalized_version,
running install
running bdist_egg
running egg_info
writing lib/Iris.egg-info/PKG-INFO
writing dependency_links to lib/Iris.egg-info/dependency_links.txt
writing top-level names to lib/Iris.egg-info/top_level.txt
reading manifest file 'lib/Iris.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '' found under directory 'docs/iris/build'
warning: no files found matching '
.cc' under directory 'src'
warning: no files found matching '.cpp' under directory 'src'
warning: no files found matching '
.h' under directory 'src'
writing manifest file 'lib/Iris.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.12-x86_64/egg
running install_lib
running build_py
/opt/local/bin/python tools/generate_std_names.py etc/cf-standard-name-table.xml build/lib/iris/std_names.py
writing [iris.fileformats._pyke_rules.compiled_krb]/fc_rules_cf_fc.py
writing [iris.fileformats._pyke_rules.compiled_krb]/compiled_pyke_files.py
Traceback (most recent call last):
File "setup.py", line 229, in
'clean_source': CleanSource},
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/command/install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 161, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 147, in call_command
self.run_command(cmdname)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/setuptools/command/install_lib.py", line 11, in run
self.build()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/command/install_lib.py", line 105, in build
self.run_command('build_py')
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 180, in run
MakePykeRules._pyke_rule_compile()
File "setup.py", line 134, in _pyke_rule_compile
knowledge_engine.engine(iris.fileformats._pyke_rules)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyke/knowledge_engine.py", line 110, in __init__
target_package.load(self, **kws)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyke/target_pkg.py", line 366, in load
self.do_by_ext('load', target_filename, engine, load_flags)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyke/target_pkg.py", line 265, in do_by_ext
return getattr(self, "%s_%s" % (prefix, ext))(filename, *args)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyke/target_pkg.py", line 374, in load_py
self.load_module(module_path, target_filename, engine)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyke/target_pkg.py", line 407, in load_module
module = import_(module_path)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyke/target_pkg.py", line 463, in import_
mod = __import__(modulename)
ModuleNotFoundError: No module named 'iris.fileformats._pyke_rules.compiled_krb'

I have the same issue, and same error as @Marston . Has anyone figured out how to fix this?

@KasianaMac

I also had this error, but after running python3 setup.py install --user a second time the install completed.

Was this page helpful?
0 / 5 - 0 ratings