trendmanagement / Tmqr-framework-2

3 stars 0 forks source link

Alex - Help smartcampaign compile error on webserver VM by Thursday Nov 21 2017 #90

Open spickering-git opened 6 years ago

spickering-git commented 6 years ago

@alexveden

installed smart-campaign module onto webserver for jupyter-hub

https://66.70.157.69/user/tmqrwebroot/notebooks/GSF_example%2BPortfolio%2B1.ipynb login with tmqrwebroot and its corresponding password

Could you please have a look at the following bug related to CompileError Not sure how to get it to work, Is it a version issue? If this is a python version issue, what should we do to avoid problems like this across the multiple versions of Jupyter.

`--------------------------------------------------------------------------- DistutilsExecError Traceback (most recent call last) /anaconda3/lib/python3.6/distutils/unixccompiler.py in _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts) 117 self.spawn(compiler_so + cc_args + [src, '-o', obj] + --> 118 extra_postargs) 119 except DistutilsExecError as msg:

/anaconda3/lib/python3.6/distutils/ccompiler.py in spawn(self, cmd) 908 def spawn(self, cmd): --> 909 spawn(cmd, dry_run=self.dry_run) 910

/anaconda3/lib/python3.6/distutils/spawn.py in spawn(cmd, search_path, verbose, dry_run) 35 if os.name == 'posix': ---> 36 _spawn_posix(cmd, search_path, dry_run=dry_run) 37 elif os.name == 'nt':

/anaconda3/lib/python3.6/distutils/spawn.py in _spawn_posix(cmd, search_path, verbose, dry_run) 158 "command %r failed with exit status %d" --> 159 % (cmd, exit_status)) 160 elif os.WIFSTOPPED(status):

DistutilsExecError: command 'gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

CompileError Traceback (most recent call last) /anaconda3/lib/python3.6/site-packages/pyximport/pyximport.py in load_module(name, pyxfilename, pyxbuild_dir, is_package, build_inplace, language_level, so_path) 214 so_path = build_module(module_name, pyxfilename, pyxbuild_dir, --> 215 inplace=build_inplace, language_level=language_level) 216 mod = imp.load_dynamic(name, so_path)

/anaconda3/lib/python3.6/site-packages/pyximport/pyximport.py in build_module(name, pyxfilename, pyxbuild_dir, inplace, language_level) 190 inplace=inplace, --> 191 reload_support=pyxargs.reload_support) 192 assert os.path.exists(so_path), "Cannot find: %s" % so_path

/anaconda3/lib/python3.6/site-packages/pyximport/pyxbuild.py in pyx_to_dll(filename, ext, force_rebuild, build_in_temp, pyxbuild_dir, setup_args, reload_support, inplace) 101 obj_build_ext = dist.get_command_obj("build_ext") --> 102 dist.run_commands() 103 so_path = obj_build_ext.get_outputs()[0]

/anaconda3/lib/python3.6/distutils/dist.py in run_commands(self) 954 for cmd in self.commands: --> 955 self.run_command(cmd) 956

/anaconda3/lib/python3.6/distutils/dist.py in run_command(self, command) 973 cmd_obj.ensure_finalized() --> 974 cmd_obj.run() 975 self.have_run[command] = 1

/anaconda3/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py in run(self) 184 --> 185 _build_ext.build_ext.run(self) 186

/anaconda3/lib/python3.6/distutils/command/build_ext.py in run(self) 338 # Now actually compile and link everything. --> 339 self.build_extensions() 340

/anaconda3/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py in build_extensions(self) 192 ext.sources = self.cython_sources(ext.sources, ext) --> 193 self.build_extension(ext) 194

/anaconda3/lib/python3.6/distutils/command/build_ext.py in build_extension(self, ext) 532 extra_postargs=extra_args, --> 533 depends=ext.depends) 534

/anaconda3/lib/python3.6/distutils/ccompiler.py in compile(self, sources, output_dir, macros, include_dirs, debug, extra_preargs, extra_postargs, depends) 573 continue --> 574 self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) 575

/anaconda3/lib/python3.6/distutils/unixccompiler.py in _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts) 119 except DistutilsExecError as msg: --> 120 raise CompileError(msg) 121

CompileError: command 'gcc' failed with exit status 1

During handling of the above exception, another exception occurred:

ImportError Traceback (most recent call last)

in () 4 5 import pandas as pd ----> 6 from smartcampaign import SmartCampaignBase 7 from smartcampaign.tools import * 8 import os /smart_campaign_project/smartcampaign/__init__.py in () ----> 1 from .base import SmartCampaignBase /smart_campaign_project/smartcampaign/base.py in () 1 import pandas as pd 2 import numpy as np ----> 3 from smartcampaign.tools import risk_atr, risk_atrmax, risk_ddavg, risk_ddq95, risk_ddmax, atr_nonull 4 import math 5 import matplotlib.pyplot as plt /smart_campaign_project/smartcampaign/tools.py in () 2 import numpy as np 3 import pyximport; pyximport.install() ----> 4 from smartcampaign.tools_fast import atr_nonull_eqty 5 6 /anaconda3/lib/python3.6/site-packages/pyximport/pyximport.py in load_module(self, fullname) 456 self.pyxbuild_dir, 457 build_inplace=self.inplace, --> 458 language_level=self.language_level) 459 return module 460 /anaconda3/lib/python3.6/site-packages/pyximport/pyximport.py in load_module(name, pyxfilename, pyxbuild_dir, is_package, build_inplace, language_level, so_path) 229 name, traceback.format_exception_only(*sys.exc_info()[:2]))) 230 if sys.version_info[0] >= 3: --> 231 raise exc.with_traceback(tb) 232 else: 233 exec("raise exc, None, tb", {'exc': exc, 'tb': tb}) /anaconda3/lib/python3.6/site-packages/pyximport/pyximport.py in load_module(name, pyxfilename, pyxbuild_dir, is_package, build_inplace, language_level, so_path) 213 module_name = name 214 so_path = build_module(module_name, pyxfilename, pyxbuild_dir, --> 215 inplace=build_inplace, language_level=language_level) 216 mod = imp.load_dynamic(name, so_path) 217 if is_package and not hasattr(mod, '__path__'): /anaconda3/lib/python3.6/site-packages/pyximport/pyximport.py in build_module(name, pyxfilename, pyxbuild_dir, inplace, language_level) 189 setup_args=sargs, 190 inplace=inplace, --> 191 reload_support=pyxargs.reload_support) 192 assert os.path.exists(so_path), "Cannot find: %s" % so_path 193 /anaconda3/lib/python3.6/site-packages/pyximport/pyxbuild.py in pyx_to_dll(filename, ext, force_rebuild, build_in_temp, pyxbuild_dir, setup_args, reload_support, inplace) 100 try: 101 obj_build_ext = dist.get_command_obj("build_ext") --> 102 dist.run_commands() 103 so_path = obj_build_ext.get_outputs()[0] 104 if obj_build_ext.inplace: /anaconda3/lib/python3.6/distutils/dist.py in run_commands(self) 953 """ 954 for cmd in self.commands: --> 955 self.run_command(cmd) 956 957 # -- Methods that operate on its Commands -------------------------- /anaconda3/lib/python3.6/distutils/dist.py in run_command(self, command) 972 cmd_obj = self.get_command_obj(command) 973 cmd_obj.ensure_finalized() --> 974 cmd_obj.run() 975 self.have_run[command] = 1 976 /anaconda3/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py in run(self) 183 optimization.disable_optimization() 184 --> 185 _build_ext.build_ext.run(self) 186 187 def build_extensions(self): /anaconda3/lib/python3.6/distutils/command/build_ext.py in run(self) 337 338 # Now actually compile and link everything. --> 339 self.build_extensions() 340 341 def check_extensions_list(self, extensions): /anaconda3/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py in build_extensions(self) 191 for ext in self.extensions: 192 ext.sources = self.cython_sources(ext.sources, ext) --> 193 self.build_extension(ext) 194 195 def cython_sources(self, sources, extension): /anaconda3/lib/python3.6/distutils/command/build_ext.py in build_extension(self, ext) 531 debug=self.debug, 532 extra_postargs=extra_args, --> 533 depends=ext.depends) 534 535 # XXX outdated variable, kept here in case third-part code /anaconda3/lib/python3.6/distutils/ccompiler.py in compile(self, sources, output_dir, macros, include_dirs, debug, extra_preargs, extra_postargs, depends) 572 except KeyError: 573 continue --> 574 self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) 575 576 # Return *all* object filenames, not just the ones we just built. /anaconda3/lib/python3.6/distutils/unixccompiler.py in _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts) 118 extra_postargs) 119 except DistutilsExecError as msg: --> 120 raise CompileError(msg) 121 122 def create_static_lib(self, objects, output_libname, ImportError: Building module smartcampaign.tools_fast failed: ["distutils.errors.CompileError: command 'gcc' failed with exit status 1\n"]`
alexveden commented 6 years ago

I can definitely say so far, but I do believe that this is related to python headers or build-tools essential in linux. I need to spend some time to investigate this on Monday.

alexveden commented 6 years ago

Unfortunately, I have failed to log in to the Jupyter Hub. But I have implemented one fix for this common error.