spyder

Spyder does not run new changes in code

帅比萌擦擦* 提交于 2019-12-11 09:27:46
问题 I am trying to update Python 3.6 code with Spyder 3.2.4 (through Anaconda), but when I make a change to the code that I am working on and attempt to run it, it will run the code that I started the session with. Does anyone know of any solutions to this? 回答1: change the directory of .py that you are working on. Right click to sample.py(which is above of console) and choose set console working directory. You can apply it for each python file while working on it. I had also same problem and did

Same Interpreter(?), Different Package Version in Spyder

爱⌒轻易说出口 提交于 2019-12-11 09:17:42
问题 I got this import error, which as this answer indicates occurs because the requests package is out of date. I updated the package using pip , but still got the same error. So I tried from requests.utils import to_native_string , which to my surprise works just fine in either the command prompt shell or IDLE, but throws an error in Spyder. I checked the version of the requests package: import requests print(requests.__version__) The version number in Spyder ( '1.2.3' ) is indeed different from

Spyder interactive plot : wait for the plot to be closed to continue

南笙酒味 提交于 2019-12-11 07:07:11
问题 I'm working with windows using Spyder, I plot with matplotlib. My problem is that I want to do interactive plot (or sometimes plotting a lot of things) and I want spyder to wait that I close the figure to continue the code (same way as a traditional terminal would). I tried plt.ion(), %mpl TkAgg before loading matplotlib, Ipython and python console... And I can't find any solution. If you want an example, the goal is that the "hello" prints only when I close the figure, with Spyder on windows

turtle.done() not working in Spyder

寵の児 提交于 2019-12-11 06:36:33
问题 This simple Python script: import turtle bob = turtle.Turtle() bob.forward(50) turtle.done() yields an error when running it using Spyder. The first run works as expected, but after that, the IPython console raises a "Terminator". The same happens when using turtle.exitonclick() instead of turtle.done() . What am I doing wrong? Note that running it from the CLI works fine. 回答1: I don't use Spyder but have exchanged comments with others who have similar problems running turtle in similar

Pyspark: SparkContext definition in Spyder throws Java gateway error

僤鯓⒐⒋嵵緔 提交于 2019-12-11 06:03:09
问题 I would like to use Spyder with pyspark (spark-2.1.1) but I cannot fix a rather frustrating Java error. I launch spyder from command line in Windows 10 after activating a conda environment (Python version is 3.5.3). This is my code: import pyspark sc = pyspark.SparkContext("local") file = sc.textFile("C:/test.log") words = file.flatMap(lambda line : line.split(" ")) words.count() When I try to define sc i get the following error: File "D:\spark-2.1.1-bin-hadoop2.7\python\pyspark\java_gateway

Suppressing ipdb output in Spyder iPython interpreter

蹲街弑〆低调 提交于 2019-12-11 05:41:33
问题 I have reason to believe that my iPython interpreter is causing my kernel to die and restart similar to the issues logged in this link and that link. The latter link indicates that the error is caused by the fact that the debugger outputs step-by-step ipdb content into the interpreter. One user reported that the behavior stopped when he (and I quote) disabled logging to console before running in debug mode How does one "disable logging to console" in Spyder IDE/IPython? I really need to do

How to suppress a certain warning in Spyder editor?

耗尽温柔 提交于 2019-12-11 05:34:43
问题 The editor in Spyder always gives me warnings for unused imports/variables immediately after I type the line. I want to suppress such warnings. How do I do that? And I want this to happen for every file I open in the Spyder editor, wouldn't prefer local fixes. I tried adding 'disable=' in ~/.pylintrc and it didn't work. Moreover, the Spyder editor uses pyflakes anyway. 回答1: You need to go to Tools > Preferences > Editor > Code Introspection/Analysis and deactivate the option called Real-time

ModuleNotFoundError in Spyder

杀马特。学长 韩版系。学妹 提交于 2019-12-11 05:07:02
问题 I tried to import the biopython package in Spyder. I always get the error message ModuleNotFoundError: No module named 'biopython' although biopython is installed. I also checked the PYTHONPATH: there is a path set into the directory where the packages are stored. Can somebody help? Did I miss something? Thanks for your help! 回答1: If you're using Anaconda, it's best to install all the packages you want from Anaconda if possible. You can check if a package is available with (e.g.): conda

Python 2.7: Unable to import matplotlib.pyplot

时光怂恿深爱的人放手 提交于 2019-12-11 04:22:35
问题 When I tried to import matplotlib.pyplot as plt I was given the following error: runfile('/Users/Zhengnan/Documents/Python/PS 2/230I_PS_2.py', wdir='/Users/Zhengnan/Documents/Python/PS 2') Traceback (most recent call last): File "<ipython-input-2-9001323bba15>", line 1, in <module> runfile('/Users/Zhengnan/Documents/Python/PS 2/230I_PS_2.py', wdir='/Users/Zhengnan/Documents/Python/PS 2') File "/Users/Zhengnan/anaconda/lib/python2.7/site-packages/spyderlib/widgets/externalshell/sitecustomize

Prevent Python kernal from crashing when running an application in QT

浪尽此生 提交于 2019-12-11 02:57:23
问题 I am attempting to write a program using PysideQT using Spyder. While the application runs fine from command line, the program causes the Python's Kernel to crash when running from Spyder's interpretive Python kernel. I cannot figure out what is causing the issue. I am running Ubuntu LTS 14.04 on a 64bit system. Once again, this issue does not occur when I run the program from terminal. I have written the following program that causes the Kernel to crash: import sys import PySide.QtGui as qg