spyder

Error importing the installed pygame module

吃可爱长大的小学妹 提交于 2019-12-11 17:19:01
问题 I'm currently doing a project on my school pc and I want to use pygame , since I have experience with pygame . I have downloaded pygame using this line in the command prompt python -m pip install -U pygame --user when I try this line python3 -m pygame.examples.aliens that is used to see if pygame is downloaded right, it works fine. But, when I import it in the project I get this error message File "C:/Users/user/Documents/Programming/test.py", line 10, in import pygame ModuleNotFoundError: No

Function object in spyder not working properly

我怕爱的太早我们不能终老 提交于 2019-12-11 17:07:51
问题 When I am building a function in python, using spyder, the function object is not working properly. e.g., def first_order(y,t): tau=5 After introducing the 2nd line it automatically closes the function. How can I change this behavior? It used to be like this def first_order(y,t): > tau=5 ...: (first Enter, creates a new line) (second Enter, to close the function) 回答1: Spyder uses IPython in its interactive console. What you report is a bug in IPython 7.0, so the cleanest solution is to

Recovering deleted file from Spyder file explorer

孤者浪人 提交于 2019-12-11 15:59:35
问题 There's a topic on this from November 2016 with an answer stating that it will be implemented in version 3.0.2. I'm running v3.2.3. I've accidentally deleted a folder of scripts in the Spyder file explorer. Is there a way to recover them? 来源: https://stackoverflow.com/questions/46497874/recovering-deleted-file-from-spyder-file-explorer

Recover overwritten .py file overwitten using Spyder

依然范特西╮ 提交于 2019-12-11 15:39:13
问题 I know I should have used version control but I have accidentally overwritten a script (.py file) by saving another script with exactly the same name while using Spyder. Is there any way at all this can be recovered? 回答1: Once the file has been compiled to a pyc it is lost. If you still have the old pyc file you may be able to decompile it: Is it possible to decompile a compiled .pyc file into a .py file? 来源: https://stackoverflow.com/questions/54675041/recover-overwritten-py-file-overwitten

Anaconda on Mac: Can't set Matplotlib backend to Agg

那年仲夏 提交于 2019-12-11 15:35:11
问题 I want to set Spyder to use a non-interactive matplotlib backend, so that plot figures do not pop up but I can still save figures to file, like this hint. However, it looks like Spyder automatically imports matplotlib and sets the backend internally somewhere, so any call I make to matplotlib.use() pops an error saying that MPL has already been called. Prefs show that "automatically import PyLab" is disabled. Also there is no 'Agg' backend in the dropdown list. How do I use a non-interactive

Can I prevent Spyder from displaying inline images temporarily?

纵饮孤独 提交于 2019-12-11 15:14:36
问题 In the Spyder IDE, I want to keep the inline console plotting (I don't want separate windows to spawn for each plot), but I want to programmatically disable plotting, i.e. in different cells. In my workflow I need to plot a few simple graphs, and then generate figures and save them as video frames (many thousands). My frames are created by loading a jpg image, and then overlaying some annotation i.e.; for jpg_path in path_list: img = mpl.image.imread(jpg_path) ax.imshow(img) ax.text(etc...)

Error while loading json in Python

吃可爱长大的小学妹 提交于 2019-12-11 14:19:14
问题 I'm parsing JSON in python but couldn't figure out the correct way to get the data. I'm accessing JSON data from sql table called "table1" in python Parsing the data and updating those records back in " table1 ". So this is my sql table R_GEOCODE_ID JSON Street_Numb Street_Name Route sublocality Country ... 12 <json_objects> NA NA NA NA NA ... 40 <json_objects> NA NA NA NA NA ... 30 <json_objects> NA NA NA NA NA ... In above table the actual JSON data could not be accumulated so I'm pasting

Incorrect behaviour of print() when executed from within a QTDialog window in Spyder

孤街醉人 提交于 2019-12-11 12:48:54
问题 I am working on a very simple interface to explore/graph csv files. My aim is ultimately to explore, not to build software as I am not a developer, more of a "desperate user" :-) I am leveraging the code found in this example These are my first steps both in Python and in GUI, so I tend to put print messages in my calls so that I can more or less track what is happening. And this is where I found a strange behavior if I run the code from within Spyder. import sys import os from PyQt4 import

Shortcuts for Switching Scripts within Editor in Spyder

烈酒焚心 提交于 2019-12-11 11:41:07
问题 Does anyone know the shortcuts to switch between different scripts opened in Spyder? I know that Ctrl + Shift + E is for switching to editor, but within the editor, is there any ways to switch with just keyboards? 回答1: You can switch between files with CTRL + Pageup / Pagedown , but there is still an open issue with that https://code.google.com/p/spyderlib/issues/detail?id=43. For me it works fine in the currentversion. 回答2: You can also use Ctrl + P to show a widget listing all your open

Why do the environment variables set in command prompt have no effect when I start Spyder

流过昼夜 提交于 2019-12-11 09:43:29
问题 I am using the Spyder Anaconda IDE for Python. I am writing a code in the Spyder IDE that requires few environment variables to be set ($CPATH, $LIBRARY_PATH and $LD_LIBRARY_PATH) for the Theano library. I am starting Spyder using the command sudo ./spyder and it starts fine. Even though I set the environment variables in my /root/.bashrc file, the code still fails to accept the path and if I try printing print os.environ["LD_LIBRARY_PATH"] it raises a KeyError. I tried all the above with a