Skip to content

os.errno doesn't exists anymore in Python 3.7 #1253

@artix41

Description

@artix41

Informations

  • Qiskit Terra version: 0.6.1
  • Python version: 3.7.0 − Jupyter Notebook
  • Operating system: Ubuntu 16.04.1

What is the current behavior?

I used circuit_drawer() on a Jupyter notebook without having latex installed on my computer, but instead of getting the message WARNING: Unable to compile latex. Is pdflatex installed?, I got the following error:

~/miniconda3/envs/qiskit/lib/python3.7/site-packages/qiskit/tools/visualization/_circuit_visualization.py in latex_circuit_drawer(circuit, basis, scale, filename, style)
    292                            check=True)
    293         except OSError as e:
--> 294             if e.errno == os.errno.ENOENT:
    295                 logger.warning('WARNING: Unable to compile latex. '
    296                                'Is `pdflatex` installed? '

AttributeError: module 'os' has no attribute 'errno'

Suggested solutions

Replacing os.errno by just errno (after having imported it). See for instance this thread on the Python bug tracker

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions