When I start Spyder, it automatically imports pandas
and numpy
. Is it possible to have Spyder ignore these modules?
I see these are imported in multiple Spyderlib files. For example, pandas
gets imported in spyderlib/widgets/importwizard.py
, spyderlib/baseconfig.py
, etc.
(I'm trying to debug something in pandas
and I'd like to import it for the first time in a debugging session in Spyder)
(Spyder dev here) This is not possible. If Pandas is installed on the same Python installation where Spyder is, then Spyder will import Pandas to: a) report to its users the minimal version needed to view DataFrames in the Variable Explorer and b) import csv files as DataFrames.
The only solution I can suggest you is this:
Create a new virtualenv or conda environment
Install there Spyder and its dependencies, but not Pandas. Spyder dependencies can be checked under the menu Help > Optional dependencies
Start your virtualenv/conda env Spyder
Go to
Tools > Preferences > Console > Advanced Settings > Python executable
select the option Use the following Python interpreter
and write (or select) there the path to the interpreter where you have Pandas installed (e.g. /usr/bin/python
)
Start a new Python/IPython console and import pandas there.