Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
artix41 opened this issue Nov 10, 2018 · 1 comment · Fixed by #1257
Closed

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

artix41 opened this issue Nov 10, 2018 · 1 comment · Fixed by #1257
Assignees
Labels
bug Something isn't working

Comments

@artix41
Copy link

artix41 commented Nov 10, 2018

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

@diego-plan9 diego-plan9 self-assigned this Nov 12, 2018
@diego-plan9 diego-plan9 added the bug Something isn't working label Nov 12, 2018
@diego-plan9
Copy link
Member

Thanks @artix41 for the report - and for taking the time of provide a spot-on and informative suggested solution!

sengthai pushed a commit to sengthai/qiskit-terra that referenced this issue Aug 23, 2023
…le order (Qiskit#6658)

* Make tweedledum a hard requirement

This commit switches the tweedledum requirement from being optional to a
hard requirement for installing qiskit-terra. We rely on tweedledum to
synthesize phase oracles which is commonly used functionality and several
issues have been opened. This use of tweedledum will likely continue to
grow so we should just list it as a requirement moving forward.

We originally made it optional because the functionality depending on
tweedledum was isolated to just the classical function compiler which
wasn't widely used. There were also packaging issues in the past where
the available precompiled binaries for tweedledum didn't support all of
our supported environments, but those have been resolved. There is still
an issue for arm64 macOS binaries but Qiskit doesn't have wide support
for that yet (although there is a job for terra).

At the same time this commit cleans up the optional requirements list
so that aer is no longer listed there and we add an 'all' extra so that
people can have a simple entypoint to install all the optional extras at
once.

Fixes Qiskit#6333
Fixes Qiskit#1253

* Remove unused imports

* Cleanup docstrings

* black setup

* Update requirements.txt

Co-authored-by: Bruno Schmitt <[email protected]>

* User defined variable order for oracle expressions

* Fix lint problems

* Update qiskit/circuit/classicalfunction/boolean_expression.py

Co-authored-by: Luciano Bello <[email protected]>

* Tests and bug-fix

* black

* Add reno

* black

* Consider order in the parameters

* black

---------

Co-authored-by: Matthew Treinish <[email protected]>
Co-authored-by: Luciano Bello <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants