I'm trying to set up a slightly customised version of Spyder. When Spyder starts, it automatically imports a long list of modules, including things from matplotlib, numpy, scipy etc. Is there a way to add my own modules to that list?
In case it makes a difference, I'm using the Spyder configuration provided by the Python(X,Y) Windows installer.
Use the "Default Programs" interface and select the executable for your Spyder,try the "Set Associations" menu and use browse to select your executable. just need to be patient, to wait for a few seconds. Save this answer.
Q: How do I reset Spyder's preferences to the defaults? Either use the Reset Spyder to factory defaults under Tools in Spyder's menu bar, the Reset Spyder settings Start menu shortcut (Windows), or run spyder --reset in your system terminal (Anaconda prompt on Windows).
First you have to create a Python file with the modules you want to import at startup. Suppose you call it my_imports.py
and that it has this contents:
import numpy as np
import matplotlib.pyplot as plt
Then you have to go to
Tools > Preferences > IPython Console > Startup > Run a file
select the option
Use the following file
and finally click on the button to the right of text field below that option to select your my_imports.py
file.
The startup script for Spyder is in site-packages/spyderlib/scientific_startup.py
.
Carlos' answer would also work, but this is what I was looking for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With