grape icon indicating copy to clipboard operation
grape copied to clipboard

NameError: name 'HASWELL_FLAGS' is not defined

Open caufieldjh opened this issue 1 year ago • 1 comments

Another hardware-related oddity, courtesy of our aging build server. When I import grape, it raises NameError: name 'HASWELL_FLAGS' is not defined - this is on our build server, where we previously had issues with missing AVX flags. In this case, I'm also in a Docker container and in a virtualenv, but it happens outside that env, too.

Python 3.9.5 (default, Nov 23 2021, 15:27:38)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import grape
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/root/.cache/pypoetry/virtualenvs/semsim-op1wFzG_-py3.9/lib/python3.9/site-packages/grape/__init__.py", line 9, in <module>
    from embiggen import *
  File "/root/.cache/pypoetry/virtualenvs/semsim-op1wFzG_-py3.9/lib/python3.9/site-packages/embiggen/__init__.py", line 2, in <module>
    from embiggen.visualizations import GraphVisualizer
  File "/root/.cache/pypoetry/virtualenvs/semsim-op1wFzG_-py3.9/lib/python3.9/site-packages/embiggen/visualizations/__init__.py", line 2, in <module>
    from embiggen.visualizations.graph_visualizer import GraphVisualizer
  File "/root/.cache/pypoetry/virtualenvs/semsim-op1wFzG_-py3.9/lib/python3.9/site-packages/embiggen/visualizations/graph_visualizer.py", line 17, in <module>
    from ensmallen import Graph  # pylint: disable=no-name-in-module
  File "/root/.cache/pypoetry/virtualenvs/semsim-op1wFzG_-py3.9/lib/python3.9/site-packages/ensmallen/__init__.py", line 27, in <module>
    ).format(HASWELL_FLAGS, unavailable_flags)
NameError: name 'HASWELL_FLAGS' is not defined

Looks like this could fail more gracefully, at least.

caufieldjh avatar Aug 31 '22 18:08 caufieldjh

Yeah, my bad, I'm going to fix it and push it as soon as possible.

In the meanwhile you can patch it out by removing from line 22 to line 28 of the file /root/.cache/pypoetry/virtualenvs/semsim-op1wFzG_-py3.9/lib/python3.9/site-packages/ensmallen/__init__.py

zommiommy avatar Aug 31 '22 19:08 zommiommy

Resolved with version 0.1.24.

LucaCappelletti94 avatar Sep 10 '22 21:09 LucaCappelletti94