Spyder default module import list

半世苍凉 提交于 2019-12-03 03:10:50

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 Spyder is executed as a python script by python binary, then you should be able to simply edit Spyder python sources and include the modules you need. You should take a look into how is it actually executed upon start.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!