These are chat archives for spyder-ide/public

4th
Apr 2019
關佳怡
@chiayikuan20_twitter
Apr 04 06:10
I can't open Spyder, How can I find my problem.
CAM Gerlach
@CAM-Gerlach
Apr 04 06:27
@chiayikuan20_twitter What operating system and version are you running? How did you install Spyder (Anaconda/Miniconda? pip? WinPython? Macports/brew? Linux package manager?) What version of Spyder are you running (if you don't know, how recently did you install/update it)?
guall28
@guall28
Apr 04 12:40
I have an error code when i try to open Spyder (Loadlibrary error 1114). Do you have any idea?
Anaconda - WinPython
CAM Gerlach
@CAM-Gerlach
Apr 04 14:03

@guall28 This is an issue with your graphics drivers or related subsystems, and is unrelated to Spyder and outside of our control. In paricular, reports suggest it has to do with GPU switching on laptops, e.g. Nvidia Optimus or AMD Switchable Graphics. Try all of the fixes mentioned here, including switching to one card or the other, disabling one or the other in device manager and updating your OS and graphics drivers. Also, make sure Spyder is the latest version, which is currently 3.3.4 (you can check with conda list spyder in the Anaconda prompt; update with conda update spyder spyder-kernels). Make sure you're launching Spyder from the shortcut or the Anaconda prompt, since it is strictly faster than launching from Anaconda Navigator and the latter can sometimes cause errors. Finally, if none of that works, send me the output of conda list qt and I Can give you further suggestions.. Thanks!

Anaconda - WinPython

Those are two different scientific Python distributions. Are you meaning to say you tried both of them?

DeepaMahm
@DeepaMahm
Apr 04 16:29
Hi , I am new to spyder IDE..Could someone help me with specifying the input and output file name arguments?
runfile('I:/toy10/to_local_parameters.py', wdir='I:/toy10/',args='I:/toy10/COPASI/Input.txt' 'I:/toy10/COPASI/out.txt')
I tried the above
It doesn't work
CAM Gerlach
@CAM-Gerlach
Apr 04 16:33
@DeepaMahm As the warning message on runfile states, it is an internal command that is only intended to be used by the Spyder IDE, not called from the command line or in your code. You can configure working directory, arguments, and other run configuration settings from Run > Run configuration.
DeepaMahm
@DeepaMahm
Apr 04 16:37
@CAM-Gerlach I had a look at > Run configuration. I am not sure if I undertsand how to specify the input and output file names. For instance while running in command line I specify: to_local-parameters.py Input.txt out.txt
My code has the following,
if name == "main":
if len(sys.argv) < 3:
    print ("Usage: to_local_parameters <input_copasi_file> <output_copasi_file>")
    sys.exit(0)

input_file = sys.argv[1]
output_file = sys.argv[2]
@CAM-Gerlach Where the input and output filenames are taken as arguments
CAM Gerlach
@CAM-Gerlach
Apr 04 16:50
@DeepaMahm Just list them under the Command line arguments box in the run configuration. Worked fine for me testing your example code.
That being said, I'd strongly recommend using argparse to handle your args rather than rolling your own code, as it will be much easier to use and extend, give you much more helpful help and debug messages, and avoid common errors and extra work.
Also, I'd recommend implementing a Python API for your code rather than just a command-line entry point, to enable calling it in a main.py script as is conventional. In fact, Spyder 4 will support defining a main script for each project, which can be automatically run with a single shortcut no matter what file you are currently working on.
guillermonevett
@guillermonevett
Apr 04 19:25
Hi
CAM Gerlach
@CAM-Gerlach
Apr 04 19:25
Hello @guillermonevett , how can we help you with Spyder?
guillermonevett
@guillermonevett
Apr 04 19:25
I'm new to python and not experienced in coding, so this question mights be stupid. Does anyone know how to save the console log into a file?
CAM Gerlach
@CAM-Gerlach
Apr 04 19:28
@guillermonevett In the Console, Ctrl-Shift-A to select all, Ctrl-C to copy and then just paste it into your favorite text editor (Vim, Emacs, Sublime, NP++, TextWrangler, etc...)
Same in the history log, except the normal Ctrl-A selects all.
guillermonevett
@guillermonevett
Apr 04 19:30
I'm running a neural net and not all epochs are in the log, for whatever reason I lose the first ~200 lines
guillermonevett
@guillermonevett
Apr 04 19:41
It's ok, I ran it in the terminal and got it from there