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.

Unclean exit from ipython on MacOS

See original GitHub issue

Describe the bug

Hi, I have installed the qsharp package as described here: https://docs.microsoft.com/en-us/quantum/install-guide/python?view=qsharp-preview and have successfully run the Python examples given on my machine in an IPython environment. Hoewever, on exit I receive the following traceback:

Exception ignored in: <function Socket.__del__ at 0x1041b4290>
Traceback (most recent call last):
  File "/Users/mlxd/qstmp/qs_conda/envs/qs_env/lib/python3.7/site-packages/zmq/sugar/socket.py", line 67, in __del__
  File "/Users/mlxd/qstmp/qs_conda/envs/qs_env/lib/python3.7/site-packages/zmq/sugar/socket.py", line 105, in close
  File "/Users/mlxd/qstmp/qs_conda/envs/qs_env/lib/python3.7/site-packages/zmq/sugar/context.py", line 153, in _rm_socket
TypeError: 'NoneType' object is not callable
Exception ignored in: <function Socket.__del__ at 0x1041b4290>
Traceback (most recent call last):
  File "/Users/mlxd/qstmp/qs_conda/envs/qs_env/lib/python3.7/site-packages/zmq/sugar/socket.py", line 67, in __del__
  File "/Users/mlxd/qstmp/qs_conda/envs/qs_env/lib/python3.7/site-packages/zmq/sugar/socket.py", line 105, in close
  File "/Users/mlxd/qstmp/qs_conda/envs/qs_env/lib/python3.7/site-packages/zmq/sugar/context.py", line 153, in _rm_socket
TypeError: 'NoneType' object is not callable
Exception ignored in: <function Socket.__del__ at 0x1041b4290>
Traceback (most recent call last):
  File "/Users/mlxd/qstmp/qs_conda/envs/qs_env/lib/python3.7/site-packages/zmq/sugar/socket.py", line 67, in __del__
  File "/Users/mlxd/qstmp/qs_conda/envs/qs_env/lib/python3.7/site-packages/zmq/sugar/socket.py", line 105, in close
  File "/Users/mlxd/qstmp/qs_conda/envs/qs_env/lib/python3.7/site-packages/zmq/sugar/context.py", line 153, in _rm_socket
TypeError: 'NoneType' object is not callable

To Reproduce To attempt to rule out my python environment, I set up a clean miniconda build and ran the example from there:

cd ~ && mkdir qstmp && cd qstmp
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
chmod +x ./Miniconda3-latest-MacOSX-x86_64.sh
./Miniconda3-latest-MacOSX-x86_64.sh -b -p ./qs_conda
source ./qs_conda/bin/activate ;
conda create -n qs_env -y python
conda activate qs_env
dotnet tool install -g Microsoft.Quantum.IQSharp
dotnet iqsharp install
dotnet iqsharp --version
dotnet tool update -g Microsoft.Quantum.IQSharp
pip install qsharp --upgrade
conda install ipython -y
ipython -c "import qsharp"

The result was as listed above. Running ipython -c "import zmq" gave no output.

Expected behavior There should be no output/traceback from importing the qsharp module and exiting.

System information

  • OS: MacOS 10.14.6
  • iqsharp: 0.9.1908.2906
  • Jupyter Core: 1.1.14623.0

If I can give any more input, feel free to let me know.

Thanks, Lee.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
bromegcommented, Oct 10, 2019

Thank you for reporting this! We’re having some trouble reproducing this reliably on our end, but we are investigating what might be causing this bug.

0reactions
rmshaffercommented, Jun 9, 2020

This appears to be a garbage collection issue in the pyzmq project, tracked by https://github.com/zeromq/pyzmq/issues/1356. It is harmless, since it’s just a failure during garbage collection of something that had already been released.

According to the PR https://github.com/zeromq/pyzmq/pull/1367, it is fixed in version 19.0.1 of pyzmq. I verified this by running pip install pyzmq==19.0.1 and noting that these errors on shutdown stopped occurring.

Closing this issue since it’s external, benign, and is already fixed in the upstream package. Thank you to everyone who reported this!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can I stop execution of current module in ipython without ...
I'm on a Mac atm and it works. Could be a setting or a Windows thing. Does it behave the same with a...
Read more >
Exiting IPython: How To Close The Interactive Environment
A: Exiting an IPython session in the terminal involves using commands such as exit() or quit() , or using keyboard shortcuts. In contrast, ......
Read more >
How to shut down Jupyter notebook in terminal on a ...
Just close/exit the terminal window (as well as the web browser window/tab where the notebook is open). That terminates the processes ...
Read more >
IPython reference — IPython 3.2.1 documentation
IPython can recognize lines ending in ':' and indent the next line, while also un-indenting automatically after 'raise' or 'return'. This feature uses...
Read more >
IPython Console — Spyder 5 documentation
To launch a new IPython instance, go to New console (default settings) under the Consoles menu, or use the keyboard shortcut Ctrl -...
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