Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Basics of setting up a Spyder workspace and projects

Tags:

python

spyder

I have searched for a basic tutorial regarding workspaces and projects in the Spyder IDE. What I want to understand is the basic concepts of how to use the workspace and projects to organize my code. It seems that this is perhaps basic programming skills and that is the reason why I have issues finding any kind of overview. This page seems to be related, but is actually about Eclipse and rather sparse. The Pythonxy tutorial and the documentation for Spyder does not go into any detail. Neither does the Anaconda documentation.

The questions I have are:

When should I set up a new workspace (if ever)?

When do I create a new project?

How does the PYTHONPATH depend on my workspace and project settings? Is it the same in all cases or can I customize it per workspace/project?

Are there other settings apart from the PYTHONPATH that I should configure?

How specific are the answers above to Spyder? Would it be the same for other IDEs, like Eclipse?

I am running Spyder on 64-bit Windows 7, as part of the Anaconda package.

like image 825
Fredrik Avatar asked Feb 11 '15 08:02

Fredrik


People also ask

How do you make a workspace on Spyder?

If this window or tab doesn't appear anywhere in the Spyder application, use View > Panes > Project explorer to enable the window. (2) Click on the folder icon in the upper-right corner of the Project explorer window. This icon brings up a dialog that can create a new workspace.

How do I get started with Spyder?

To open Spyder you need to click on the Home button and on the Launch icon. If Spyder does not launch via this method or you prefer to use the command line, open Anaconda Prompt (Windows) or your terminal (other platforms), type conda activate base then spyder .

How do I show Project on Spyder?

You need to go to the Projects menu, and select the option called New Project . Then you need to select the option called Existing directory , choose the directory where your project is located at in the Location field and finally press Create . That will automatically show your project in the Project Explorer.

How do I open multiple Spyder Projects?

Although clicking on the Spyder icon will not allow you to open two instances, you can open a second instance by simply going to the folder where spyder.py is and running spyder.py from the command line. Further, you could make an icon for your desktop that simply runs spyder.py from its location.


1 Answers

Update Oct 2016: Spyder 3 now has project facilities similar to that of other IDEs (especially Rstudio).

Now you if you have a folder with scripts, you can go to

Projects > New Projects > Existing Directory 

to import it. The selected directory will be set as the base directory for the project.

like image 184
Heisenberg Avatar answered Sep 20 '22 15:09

Heisenberg