question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when import qsharp

See original GitHub issue

Describe the bug When I run import qsharp I get the following error:

Preparing Q# environment...
..Exception ignored in: <function Socket.__del__ at 0x0000022710381B80>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x0000022710381B80>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x0000022710381B80>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
...........Exception ignored in: <function Socket.__del__ at 0x0000022710381B80>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x0000022710381B80>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x0000022710381B80>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x0000022710381B80>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x0000022710381B80>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError: 
Exception ignored in: <function Socket.__del__ at 0x0000022710381B80>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x0000022710381B80>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x0000022710381B80>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x0000022710381B80>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x0000022710381B80>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x0000022710381B80>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
......Q# environment was not available in allocated time.
Please check the instructions at https://aka.ms/qdk-install/python.
Traceback (most recent call last):
  File "C:\Users\xxxx\Documents\Projects\q-sharp-pythontest\host.py", line 1, in <module>
    import qsharp
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\qsharp\__init__.py", line 198, in <module>
    client = _start_client()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\qsharp\clients\__init__.py", line 67, in _start_client
    raise IQSharpNotAvailableError(message)
qsharp.clients.IQSharpNotAvailableError: Q# environment was not available in allocated time.
Please check the instructions at https://aka.ms/qdk-install/python.
Exception ignored in: <function Socket.__del__ at 0x0000022710381B80>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x0000022710381B80>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x0000022710381B80>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x0000022710381B80>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x0000022710381B80>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x0000022710381B80>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
PS C:\Users\xxxx\Documents\Projects\q-sharp-pythontest> python .\host.py
Preparing Q# environment...
..Exception ignored in: <function Socket.__del__ at 0x000002271BC9FC10>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x000002271BC9FC10>
Traceback (most recent call last):
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x000002271BC9FC10>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
...........Exception ignored in: <function Socket.__del__ at 0x000002271BC9FC10>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x000002271BC9FC10>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x000002271BC9FC10>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x000002271BC9FC10>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x000002271BC9FC10>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x000002271BC9FC10>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x000002271BC9FC10>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x000002271BC9FC10>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError: 
Exception ignored in: <function Socket.__del__ at 0x000002271BC9FC10>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x000002271BC9FC10>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x000002271BC9FC10>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
......Q# environment was not available in allocated time.
Please check the instructions at https://aka.ms/qdk-install/python.
Traceback (most recent call last):
  File "C:\Users\xxxx\Documents\Projects\q-sharp-pythontest\host.py", line 1, in <module>
    import qsharp
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\qsharp\__init__.py", line 198, in <module>
    client = _start_client()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\qsharp\clients\__init__.py", line 67, in _start_client
    raise IQSharpNotAvailableError(message)
qsharp.clients.IQSharpNotAvailableError: Q# environment was not available in allocated time.
Please check the instructions at https://aka.ms/qdk-install/python.
Exception ignored in: <function Socket.__del__ at 0x000002271BC9FC10>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x000002271BC9FC10>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x000002271BC9FC10>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x000002271BC9FC10>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x000002271BC9FC10>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:
Exception ignored in: <function Socket.__del__ at 0x000002271BC9FC10>
Traceback (most recent call last):
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\sugar\socket.py", line 67, in __del__
    self.close()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\_future.py", line 160, in close
    self._clear_io_state()
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\asyncio\__init__.py", line 60, in _clear_io_state
    self.io_loop.remove_reader(self._fd)
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 507, in remove_reader
    raise NotImplementedError
NotImplementedError:

To Reproduce My config:

  • Fresh Windows 11 install
  • VSCode
  • Python 3.9.8
  • Installed qsharp with pip install qsharp
  • Dotnet 3.1
  • install Q# SDK with:
    • dotnet tool install -g Microsoft.Quantum.IQSharp verison: 0.20.2110171573
    • dotnet iqsharp install
  • Run the following host.py:
import qsharp

Expected behavior Q# is installed correctly, when I run Q# programs from the command line it works fine.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
guenpcommented, Nov 16, 2021

It looks like the issue was resolved when installing Python 3.7.3. I’m wondering if this is a regression. Our docs mention that the QDK is compatible with Python>3.6.

0reactions
anjburcommented, Sep 27, 2022

Thank you for reporting this! It should be fixed now with #685, but please feel free to reopen if you’re still experiencing this bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

import qsharp ModuleNotFoundError: No module named ' ...
I install the python library named Python.NET package using pip install pythonnet, clr module is installed and imported, installation of qsharp ...
Read more >
Fail when import qsharp in python · Issue #355
Describe the bug. After conda installation, run % python -c "import qsharp" , Returns the following error message: Preparing Q# environment.
Read more >
Cannot import namespace from a Q# file to run it in ...
It seems like you're getting a python error trying to do a relative import, not necessarily a qsharp error. To do a relative...
Read more >
Ways to run a Q# program - Azure Quantum
To load external packages containing Q# code, use the qsharp. packages API. If the Q# code in the current folder depends on external...
Read more >
qsharp
The qsharp package for Python provides interoperability with the Quantum Development Kit and with the Q# language, making it easy to simulate Q#...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found