Reputation: 170598
I observed that on a new project the Run option is disabled and I expected to be able to run a script without having to manually add a configuration for it.
Upvotes: 70
Views: 111061
Reputation: 796
I tried all answers, and none worked for me. What did work is:
1.) open another repository / project
select project
> OK2.) If you have the pop-up to choose "This Window or "New Window", chose "This Window"
3.) Open the repository / project that had the greyed out run button
4.) It should be green by now
Upvotes: 0
Reputation: 11
edit configurations
.Then you will get the Run window again.
Upvotes: 1
Reputation: 2210
It is possible that when you have newly setup your pycharm environment, it starts to index the scripts. You will see something like Indexing...
at the bottom of the window. Once it is complete you can right click
and select Run
.
Upvotes: 0
Reputation: 195
I solved it just by right clicking on the .py file and clicking 'run'. After this the run button appeared enabled!
Upvotes: 10
Reputation: 1494
If you're creating a project from existing source: and If the existing source directory contains a lot of data/files:
You can speed this up by right-clicking on folders and selecting "Mark directory as..." -> "Excluded" if they aren't to be indexed.
Upvotes: 68
Reputation: 3936
If the project folder contains a lot of files then the indexing process can take a long time. So you might need to wait before the Run button appears.
Upvotes: 7
Reputation: 31
Select drop down menu to the left of the run button at the top right, select Edit configurations, expand defaults on the left, select whatever you were working on (if python, select python). Then click OK. Dialogue will close. Make sure the file that you want to run is on top. Hit ctrl+shift+F10 to run. The run button should be enabled again.
Upvotes: 3
Reputation: 402225
You can't run without a configuration, however temporary configuration can be created automatically if you use Run context menu option in the script editor.
Upvotes: 25