spyder

Interactive Python: cannot get `%lprun` to work, although line_profiler is imported properly

限于喜欢 提交于 2019-12-02 17:04:25
Problem Most iPython "magic functions" work fine for me right off the bat: %hist , %time , %prun , etc. However, I noticed that %lprun could not be found with iPython as I'd installed it originally. Attempt to Resolve I then discovered that I should install the line_profiler module. I have installed this module, but still cannot seem to get the magic function to work correctly. If I attempt to call %lprun , iPython still cannot find the function. If I call it with the full name ( line_profiler.magic_lprun ), the function can be found, but I cannot get it to work at all. Below is an example of

How do I run two separate instances of Spyder

别等时光非礼了梦想. 提交于 2019-12-02 16:08:06
I want to be able to have two instances which are completely independent in the sense that I can be working on two separate unrelated projects in different folders without any interference. ( Spyder dev here ) This is very easy. You need to go to: Tools > Prefences > General and click "Advanced Settings" tab, and deactivate the option called [ ] Use a single instance Then every time you start Spyder a new window will be opened. If you want the old behavior back, just activate that option again. You can use the --new-instance option as well. Just run spyder --new-instance Although clicking on

how to update spyder on anaconda

旧街凉风 提交于 2019-12-02 15:21:32
I have Anaconda installed (Python 2.7.11 |Anaconda custom (64-bit)| (default, Feb 16 2016, 09:58:36) [MSC v.1500 64 bit (AMD64)] on win32) and I am using Spyder 2.3.8 Would like to update Spyder to the latest version, so I went through the commands: conda update conda conda update anaconda conda update spyder They all ran without errors, but the spyder version didn't change - this is command I'm using to launch: C:\Anaconda2\pythonw.exe C:\Anaconda2\cwp.py C:\Anaconda2 "C:/Anaconda2/pythonw.exe" "C:/Anaconda2/Scripts/spyder-script.py" --new-instance Am I missing something? Thanks jrinker To

Shortcut key for commenting out lines of Python code in Spyder

时光总嘲笑我的痴心妄想 提交于 2019-12-02 15:08:17
I recently changed from the Enthought Canopy Python distribution to Anaconda, which includes the Spyder IDE. In Canopy's code editor, it was possible to comment and uncomment lines of code by pressing the "Cntrl+/" shortcut key sequence. In Spyder I was unable to find an equivalent shortcut key in the introductory tutorial. Is there a shortcut key for commenting and uncommenting code in Spyder? Suresh2692 Single line comment Ctrl + 1 Multi-line comment select the lines to be commented Ctrl + 4 Unblock Multi-line comment Ctrl + 5 Reblochon Masque On macOS: Cmd + 1 On Windows, probably Ctrl + (/

Add the text output from the console to the PyQT window

你离开我真会死。 提交于 2019-12-02 14:58:08
问题 How do I display the text output from the console to the PyQT dialog box along with the generated graph? The code below runs a heart disease predictor program and its results are presented by a graph that is generated and shown in the PyQT window. However, we also need the interpretation of the results to be displayed in the dialog box but we can't seem to figure it out. Please help. import sys from PyQt5.QtWidgets import QDialog, QApplication, QPushButton, QVBoxLayout from numpy import

No longer able to launch Spyder since updating PyQt5 via pip

放肆的年华 提交于 2019-12-02 14:08:10
问题 Since updating my python3 packages via python3-pip on Ubuntu 18.04.2 LTS I am unable to launch spyder as it appears that the QtWebKitWidgets module of the PyQt5 package has been deprecated. The following console output is produced upon entering spyder3 in the terminal: Traceback (most recent call last): File "/home/benjamin/.local/lib/python3.6/site-packages/qtpy/QtWebEngineWidgets.py", line 22, in <module> from PyQt5.QtWebEngineWidgets import QWebEnginePage ModuleNotFoundError: No module

Python Spyder choose where and when to show plots

徘徊边缘 提交于 2019-12-02 11:50:02
I'm using Spyder3.1.2 IDE with Python 3.5 in Windows 10 and would like to know how to choose whether to show my plots in the iPython console or in a separate window. I found this other question but I get an error when I type %matplotlib qt (No module named PyQt4). I have also changed the preferences to show graphics "automatically" instead of "inline", but I'm still getting them inline. What I want to end up with is a for loop where on every iteration I add a new point to my graph, which is visible immediately and is shown in a separate window to the console. Many thanks for your time You can

Code autocompletion 'partially' works in the editor pane of Spyder3

眉间皱痕 提交于 2019-12-02 10:46:14
问题 I installed spyder3 through miniconda3 on my win10 PC. Autocompletion works perfectly in the Ipython console pane but not in the editor pane. In the editor pane it only list partial completion options when I use TAB or Ctrl + Space This is my Editor preferences settings which is almost default. Should Editor pane's auto completion ability be 'weaker' than that of Ipython pane in Spyder3? 回答1: ( Spyder maintainer here ) It's a true and sad reality, but our Editor can't show the same

PyQt app doesn't exit when i close the window

时光总嘲笑我的痴心妄想 提交于 2019-12-02 10:32:02
问题 Whenever i execute the code and close the window, it closes,but the python console in the IDE doesn't return the exit code,when i try to run it again i get a warning dialog that says something like No python console is selected to run main.py So i have to close the IDE python console, and open a new one, then run the program in the new python console I'm using spyder IDE 64 bits on windows from PyQt4.QtCore import * from PyQt4.QtGui import * import sys if __name__ == "__main__": app =

Code to clear console and variables in Spyder

随声附和 提交于 2019-12-02 10:18:31
Tried many suggestions to clear console and variables in Spyder using code not CTRL+L but they do not work. wondering any effective suggestion what the code can be used for clearing Spyder console and variables. using get_ipython().magic('reset -sf') will make the variable explorer not updated. ( Spyder maintainer here ) This code both clears the console and removes all variables present on the namespace at the same time: try: from IPython import get_ipython get_ipython().magic('clear') get_ipython().magic('reset -f') except: pass It also has the advantage that it works inside and outside