سؤال

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.

هل كانت مفيدة؟

المحلول

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.

نصائح أخرى

If you're creating a project from existing source: and If the existing source directory contains a lot of data/files:

  • the Run option (and others, assumably) are disabled until PyCharm is finished indexing the contents in the project. You'll see a progress bar in the lower-right-hand corner.

You can speed this up by right-clicking on folders and selecting "Mark directory as..." -> "Excluded" if they aren't to be indexed.

Right click inside your main file & then you get Run option!

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.

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top