-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Very slow line execution using IPython in macOS #2902
Comments
This appears to affect me as well, although it's not exactly 100% reproducible. I'm not sure if the console is entering multiline mode, but sometimes, after some small number of commands, the console takes a second or so to finish any command. This makes the spyder console unusable. Ubuntu 16.04 (Xenial)
|
This just started happening for me as well after an update. Currently using: |
same here, although I am afraid I can't point to exactly what changed on my system before/after the performance loss Python 3.6.6 Mac OS X 10.14 |
Same. I'm new to anaconda/spyder and I've had this issue since I started. |
A successful work around for me has been to downgrade to spyder 3.1.4, where the python console is still available for use. This issue does not occur with the python console but does occur with the Ipython console in this version as well. Additionally this has persisted through an update from OSX 10.13 to OSX 10.14. Additionally see: https://stackoverflow.com/questions/53381373/ipython-console-in-spyder-extremely-slow-in-anaconda/53415444#53415444 Dependencies are:
|
thanks for this temporary solution @jjruby09 ! |
Yep, python console in 3.1 works for me too. Also the issue is fully reproducible for me: the ipython console is painfully slow with any code in any anaconda environment |
Posting |
@ccordoba12 I think it was a follow up to the original post above stating the configuration.
|
@jjruby09 yes. also I noticed a previous poster said it's not fully reproducible, but it is for me. Should have said that in my op. |
Same issue for me as well. |
@cgit2017, could you downgrade to ipykernel 4.10 and try again? Thanks! |
@ccordoba12 downgrading to ipykernel 4.10 seems to have solved the issue for me. |
Can others in this thread confirm @cgit2017 findings? Thanks! |
@ccordoba12 downgrading to ipykernel 4.10 seems to have fixed it for me as well. Thanks for your help! |
The following downgrades have dramatically improved (maybe even solved, time will tell) the issue for me on MacOS 10.14.1 (Mojave):
This issue has been pretty reproducible for me, so I'm willing to help test specific versions if that is helpful towards finding the final solution. |
@ccordoba12 Downgrading to ipykernel 4.10 seems to have made Spyder even slower in my case, but perhaps I should blame pyFMI, not sure (Spyder just froze entirely after loading an FMU, simulating it, and trying to read results into Python). EDIT: Too bad, it's not just pyFMI. Spyder freezes on other occasions too. MacOS 10.14.1 (Mojave) P.S. I'm only having this issue on MacOS, I've been using Spyder on Ubuntu, Raspbian, Windows, never experienced any trouble so far |
@sitadrost, could you also downgrade IPython to 6.5.0? |
Thanks, but I already tried that (see post above), didn't help, unfortunately. |
@ccordoba12 downgrading to ipykernel 4.10 in spyder 3.3.1 is working for me! |
Just did now :o) Seems to work much better, even when using the iPython console. Still a bit slow at times, but no freezes up to now. Thanks for the tip! At startup I get an error message though. It doesn't seem to prevent Spyder from running, but for sake of completeness I'm pasting it here:
|
@sitadrost, that error was fixed in Spyder 3.3 |
same here @ccordoba12 |
I just experienced an event that may help shed new light on this problem. This console is used to report application
internal errors and to inspect Spyder
internals with the following commands:
spy.app, spy.window, dir(spy)
Please don't use it to run your code
>>> Traceback (most recent call last):
File "/Users/rclary/anaconda3/envs/spyder-beta/lib/python3.7/site-packages/spyder/plugins/profiler/widgets/profilergui.py", line 271, in <lambda>
self.finished(ec, es))
File "/Users/rclary/anaconda3/envs/spyder-beta/lib/python3.7/site-packages/spyder/plugins/profiler/widgets/profilergui.py", line 342, in finished
self.show_data(justanalyzed=True)
File "/Users/rclary/anaconda3/envs/spyder-beta/lib/python3.7/site-packages/spyder/plugins/profiler/widgets/profilergui.py", line 369, in show_data
self.datatree.show_tree()
File "/Users/rclary/anaconda3/envs/spyder-beta/lib/python3.7/site-packages/spyder/plugins/profiler/widgets/profilergui.py", line 541, in show_tree
rootkey = self.find_root() # This root contains profiler overhead
File "/Users/rclary/anaconda3/envs/spyder-beta/lib/python3.7/site-packages/spyder/plugins/profiler/widgets/profilergui.py", line 522, in find_root
self.profdata.sort_stats("cumulative")
AttributeError: 'NoneType' object has no attribute 'sort_stats' Perhaps I accidentally hit "f10" to run the profiler which raised this error in the internal console. Note, however that there was no command prompt following the traceback. Within the internal console, then, I simply hit the return key, thus restoring a command prompt The actual error in the internal console may not be relevant to this issue, but I think somehow the absence of a command prompt is relevant. Any thoughts? |
I had this problem after updating Spyder from 3.2.x to 3.3.5. Updating also caused an issue of packages going missing which may or may not have been related. The problem unexpectedly went away after installing OSX Mojave 10.14.5 Installing nltk brought a suite of packages. The following NEW packages will be INSTALLED:
_anaconda_depends pkgs/main/osx-64::_anaconda_depends-2019.03-py36_0
anaconda-project pkgs/main/noarch::anaconda-project-0.8.3-py_0
appscript pkgs/main/osx-64::appscript-1.1.0-py36h1de35cc_0
astropy pkgs/main/osx-64::astropy-3.2.1-py36h1de35cc_0
atomicwrites pkgs/main/osx-64::atomicwrites-1.3.0-py36_1
backports.os pkgs/main/osx-64::backports.os-0.1.1-py36_0
backports.shutil_~ pkgs/main/osx-64::backports.shutil_get_terminal_size-1.0.0-py36_2
bitarray pkgs/main/osx-64::bitarray-0.9.3-py36h1de35cc_0
bkcharts pkgs/main/osx-64::bkcharts-0.2-py36h073222e_0
blosc pkgs/main/osx-64::blosc-1.16.3-hd9629dc_0
bokeh pkgs/main/osx-64::bokeh-1.2.0-py36_0
boto pkgs/main/osx-64::boto-2.49.0-py36_0
bottleneck pkgs/main/osx-64::bottleneck-1.2.1-py36h1d22016_1
colorama pkgs/main/osx-64::colorama-0.4.1-py36_0
contextlib2 pkgs/main/osx-64::contextlib2-0.5.5-py36hd66e5e7_0
curl pkgs/main/osx-64::curl-7.64.1-ha441bb4_0
cython pkgs/main/osx-64::cython-0.29.11-py36h0a44026_0
cytoolz pkgs/main/osx-64::cytoolz-0.9.0.1-py36h1de35cc_1
dask pkgs/main/noarch::dask-2.1.0-py_0
dask-core pkgs/main/noarch::dask-core-2.1.0-py_0
distributed pkgs/main/noarch::distributed-2.1.0-py_0
et_xmlfile pkgs/main/osx-64::et_xmlfile-1.0.1-py36h1315bdc_0
fastcache pkgs/main/osx-64::fastcache-1.1.0-py36h1de35cc_0
flask pkgs/main/osx-64::flask-1.0.3-py36_0
get_terminal_size pkgs/main/osx-64::get_terminal_size-1.0.0-h7520d66_0
gevent pkgs/main/osx-64::gevent-1.4.0-py36h1de35cc_0
gmp pkgs/main/osx-64::gmp-6.1.2-hb37e062_1
gmpy2 pkgs/main/osx-64::gmpy2-2.0.8-py36h6ef4df4_2
greenlet pkgs/main/osx-64::greenlet-0.4.15-py36h1de35cc_0
h5py pkgs/main/osx-64::h5py-2.9.0-py36h3134771_0
hdf5 pkgs/main/osx-64::hdf5-1.10.4-hfa1e0ec_0
heapdict pkgs/main/osx-64::heapdict-1.0.0-py36_2
html5lib pkgs/main/osx-64::html5lib-1.0.1-py36_0
imageio pkgs/main/osx-64::imageio-2.5.0-py36_0
importlib_metadata pkgs/main/osx-64::importlib_metadata-0.17-py36_1
ipywidgets pkgs/main/osx-64::ipywidgets-7.4.2-py36_0
itsdangerous pkgs/main/osx-64::itsdangerous-1.1.0-py36_0
jbig pkgs/main/osx-64::jbig-2.1-h4d881f8_0
jdcal pkgs/main/noarch::jdcal-1.4.1-py_0
jupyter pkgs/main/osx-64::jupyter-1.0.0-py36_7
jupyter_console pkgs/main/osx-64::jupyter_console-6.0.0-py36_0
jupyterlab pkgs/main/osx-64::jupyterlab-0.35.5-py36hf63ae98_0
jupyterlab_server pkgs/main/osx-64::jupyterlab_server-0.2.0-py36_0
krb5 pkgs/main/osx-64::krb5-1.16.1-hddcf347_7
libcurl pkgs/main/osx-64::libcurl-7.64.1-h051b688_0
libssh2 pkgs/main/osx-64::libssh2-1.8.2-ha12b0ac_0
libxslt pkgs/main/osx-64::libxslt-1.1.33-h33a18ac_0
llvmlite pkgs/main/osx-64::llvmlite-0.29.0-py36h98b8051_0
locket pkgs/main/osx-64::locket-0.2.0-py36hca03003_1
lxml pkgs/main/osx-64::lxml-4.3.4-py36hef8c89e_0
mock pkgs/main/osx-64::mock-3.0.5-py36_0
more-itertools pkgs/main/osx-64::more-itertools-7.0.0-py36_0
mpc pkgs/main/osx-64::mpc-1.1.0-h6ef4df4_1
mpfr pkgs/main/osx-64::mpfr-4.0.1-h3018a27_3
mpmath pkgs/main/osx-64::mpmath-1.1.0-py36_0
msgpack-python pkgs/main/osx-64::msgpack-python-0.6.1-py36h04f5b5a_1
multipledispatch pkgs/main/osx-64::multipledispatch-0.6.0-py36_0
networkx pkgs/main/noarch::networkx-2.3-py_0
nltk pkgs/main/osx-64::nltk-3.4.3-py36_0
nose pkgs/main/osx-64::nose-1.3.7-py36_2
notebook pkgs/main/osx-64::notebook-5.7.8-py36_0
numba pkgs/main/osx-64::numba-0.44.1-py36h6440ff4_0
numexpr pkgs/main/osx-64::numexpr-2.6.9-py36h7413580_0
openpyxl pkgs/main/noarch::openpyxl-2.6.2-py_0
partd pkgs/main/noarch::partd-1.0.0-py_0
path.py pkgs/main/noarch::path.py-12.0.1-py_0
pathlib2 pkgs/main/osx-64::pathlib2-2.3.4-py36_0
patsy pkgs/main/osx-64::patsy-0.5.1-py36_0
pep8 pkgs/main/osx-64::pep8-1.7.1-py36_0
pluggy pkgs/main/noarch::pluggy-0.12.0-py_0
ply pkgs/main/osx-64::ply-3.11-py36_0
prometheus_client pkgs/main/noarch::prometheus_client-0.7.1-py_0
py pkgs/main/osx-64::py-1.8.0-py36_0
pycrypto pkgs/main/osx-64::pycrypto-2.6.1-py36h1de35cc_9
pycurl pkgs/main/osx-64::pycurl-7.43.0.3-py36ha12b0ac_0
pyodbc pkgs/main/osx-64::pyodbc-4.0.26-py36h0a44026_0
pytables pkgs/main/osx-64::pytables-3.5.2-py36h5bccee9_1
pytest pkgs/main/osx-64::pytest-5.0.0-py36_0
pytest-arraydiff pkgs/main/osx-64::pytest-arraydiff-0.3-py36h39e3cac_0
pytest-astropy pkgs/main/osx-64::pytest-astropy-0.5.0-py36_0
pytest-doctestplus pkgs/main/osx-64::pytest-doctestplus-0.3.0-py36_0
pytest-openfiles pkgs/main/osx-64::pytest-openfiles-0.3.2-py36_0
pytest-remotedata pkgs/main/osx-64::pytest-remotedata-0.3.1-py36_0
pywavelets pkgs/main/osx-64::pywavelets-1.0.3-py36h1d22016_1
scikit-image pkgs/main/osx-64::scikit-image-0.15.0-py36h0a44026_0
seaborn pkgs/main/osx-64::seaborn-0.9.0-py36_0
send2trash pkgs/main/osx-64::send2trash-1.5.0-py36_0
simplegeneric pkgs/main/osx-64::simplegeneric-0.8.1-py36_2
singledispatch pkgs/main/osx-64::singledispatch-3.4.0.3-py36hf20db9d_0
snappy pkgs/main/osx-64::snappy-1.1.7-he62c110_3
sortedcollections pkgs/main/osx-64::sortedcollections-1.1.2-py36_0
sortedcontainers pkgs/main/osx-64::sortedcontainers-2.1.0-py36_0
sphinxcontrib pkgs/main/osx-64::sphinxcontrib-1.0-py36_1
sphinxcontrib-web~ pkgs/main/noarch::sphinxcontrib-websupport-1.1.2-py_0
sqlalchemy pkgs/main/osx-64::sqlalchemy-1.3.5-py36h1de35cc_0
statsmodels pkgs/main/osx-64::statsmodels-0.10.0-py36h1d22016_0
sympy pkgs/main/osx-64::sympy-1.4-py36_0
tblib pkgs/main/noarch::tblib-1.4.0-py_0
terminado pkgs/main/osx-64::terminado-0.8.2-py36_0
toolz pkgs/main/osx-64::toolz-0.9.0-py36_0
unicodecsv pkgs/main/osx-64::unicodecsv-0.14.1-py36he531d66_0
unixodbc pkgs/main/osx-64::unixodbc-2.3.7-h1de35cc_0
werkzeug pkgs/main/noarch::werkzeug-0.15.4-py_0
widgetsnbextension pkgs/main/osx-64::widgetsnbextension-3.4.2-py36_0
xlrd pkgs/main/osx-64::xlrd-1.2.0-py36_0
xlsxwriter pkgs/main/noarch::xlsxwriter-1.1.8-py_0
xlwings pkgs/main/osx-64::xlwings-0.15.8-py36_0
xlwt pkgs/main/osx-64::xlwt-1.2.0-py36h5ad1178_0
zict pkgs/main/noarch::zict-1.0.0-py_0
zipp pkgs/main/noarch::zipp-0.5.1-py_0 The conda-build update updated a handful of packages, but nothing is apparent to me why it might've fixed the issue. The following NEW packages will be INSTALLED:
liblief pkgs/main/osx-64::liblief-0.9.0-h2a1bed3_2
py-lief pkgs/main/osx-64::py-lief-0.9.0-py36h1413db1_2
The following packages will be REMOVED:
backports.functools_lru_cache-1.5-py_2
backports.tempfile-1.0-py_1
backports.weakref-1.0.post1-py_1
conda-verify-3.4.2-py_0
future-0.17.1-py36_0
The following packages will be UPDATED:
bzip2 1.0.6-h1de35cc_5 --> 1.0.7-h1de35cc_0
cloudpickle 1.1.1-py_0 --> 1.2.1-py_0
conda-build 3.4.1-py36_0 --> 3.18.7-py36_0
conda-package-han~ 1.3.10-py36_0 --> 1.3.11-py36_0
glob2 pkgs/main/osx-64::glob2-0.6-py36_1 --> pkgs/main/noarch::glob2-0.7-py_0
ipython 7.6.0-py36h39e3cac_0 --> 7.6.1-py36h39e3cac_0
isort 4.3.20-py36_0 --> 4.3.21-py36_0
jupyter_core pkgs/main/osx-64::jupyter_core-4.4.0-~ --> pkgs/main/noarch::jupyter_core-4.5.0-py_0
parso 0.4.0-py_0 --> 0.5.0-py_0
psutil 5.6.2-py36h1de35cc_0 --> 5.6.3-py36h1de35cc_0
python-libarchive~ 2.8-py36_6 --> 2.8-py36_10
pyyaml 5.1-py36h1de35cc_0 --> 5.1.1-py36h1de35cc_0
qtpy 1.7.1-py_0 --> 1.8.0-py_0
snowballstemmer pkgs/main/osx-64::snowballstemmer-1.2~ --> pkgs/main/noarch::snowballstemmer-1.9.0-py_0
sphinx 2.1.0-py_0 --> 2.1.2-py_0
tornado 6.0.2-py36h1de35cc_0 --> 6.0.3-py36h1de35cc_0
wrapt 1.11.1-py36h1de35cc_0 --> 1.11.2-py36h1de35cc_0 |
I just wanted to mention another workaround I have not seen here. Spyder creates a symbol for each ipython console in the dock. Code gets executed immediately, if you click on the symbol belonging to the console. Of course it is still annoying to do that almost every time. |
Command+tab to the python "application" also resolves the ipython hangs for me. Running ipython=6.4 and ipykernel=4.1. I've noticed that the hangs tend to happen after switching applications, and then switching to the python application moves it along. Is there a way to keep the python application more active in OSX? |
I think the reason the continuation prompt ( |
A good test to see if this is related to jupyter/qtconsole#380 is to enter: |
Until matplotlib/matplotlib#15314 is fixed, I would avoid using the following matplotlib backends on macos: |
I think this is caused by AppNap: https://developer.apple.com/library/archive/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/AppNap.html |
Quentin Peter --
You directed us to https://pypi.org/project/appnope/
which says it's for OS X 10.9. Current MacOS is 10.14.6.
Phil Nelson
… On Sep 21, 2019, at 3:32 PM, Quentin Peter ***@***.***> wrote:
I think this is caused by AppNap: https://developer.apple.com/library/archive/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/AppNap.html
This can be desactivated by https://pypi.org/project/appnope/
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
App nap was adding in 10.9; that's likely what its referring to. The package hasn't been updated in a while, but it is apparently still maintained (given there's been activity as recent as 2018 on the repo) and unless Apple's completely changed their API for enabling/disabling it, there should be no reason why it shouldn't still work. You could open an issue on the issue to ask that the docs be clarified, but the best thing to do is just test it yourself and see if it actually disables App Nap. |
I am using MacOS 10.14.6 and it is working for me |
Disabling App Nap was the solution for me!
Thanks to everyone!
…On Sun, Sep 22, 2019 at 2:33 AM Quentin Peter ***@***.***> wrote:
I am using MacOS 10.14.6 and it is working for me
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2902?email_source=notifications&email_token=ABAV7PHOYYU4AQTFZO4DD2DQK4GSPA5CNFSM4BX23L62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7I7PQI#issuecomment-533854145>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABAV7PB4VSV5DUYVSGUQOXLQK4GSPANCNFSM4BX23L6Q>
.
|
@impact27 could you link the PR you opened ? Thanks! |
All I did was follow Peter's suggestion & followed directions here:
This can be deactivated by https://pypi.org/project/appnope/
…On Wed, Sep 25, 2019 at 1:37 PM Gonzalo Peña-Castellanos < ***@***.***> wrote:
@impact27 <https://github.com/impact27> could you link the PR you opened
? Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2902?email_source=notifications&email_token=ABAV7PGO2P2IIETD2JYWAO3QLOOWHA5CNFSM4BX23L62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7SXGZY#issuecomment-535130983>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABAV7PFBDDGQW5IKYU54ENLQLOOWHANCNFSM4BX23L6Q>
.
|
Here is the PR: ipython/ipykernel#441 |
I think this is solved in ipykernel 5.1.3 |
This will be solved automatically in Spyder 4 for everyone that's using Python 3. Spyder 3 users need to be sure to update to ipykernel 5.1.3 or higher. Unfortunately the fix was not backported to the Python 2 version of ipykernel, sorry. |
After running a few initial commands in a new IPython console (regardless of what they may be), line execution automatically defaults to multline mode and slows down considerably.
For example:
This last line will take several seconds to execute, and all subsequently entered statements will behave similarly, making the console virtually unusable.
OSX Yosemite (10.10.5)
Spyder: 2.3.8 (installed via pip)
Python: 3.5.1 (installed using homebrew)
Qt: 4.8.7_2 (installed using homebrew)
This issue does not occur when opening a Qt console outside of the Spyder environment. Any help or suggestions would be much appreciated.
The text was updated successfully, but these errors were encountered: