Python Console error message

Answered

I am using Linux Mint.

Installed PyCharm Community, and it works fine.

The only thing I don't understand is the error message Error:Cannot start process, the working directory '/home/user1/myPython/if.py' is not a directory

I am just learning Python so I have the scripts in /home/user1/myPython/ directory.

if.py is the script.  It runs from Run --> Run

There isn't a project, just the script  if.py

3 comments
Comment actions Permalink
Official comment

Hi! Please, go to Run | Edit Configurations, select your run configuration and set the field "Working directory" to your project root, i.e. /home/user1/myPython/. Does it help?

Comment actions Permalink

I had already set the "Working directory" field to my project root /home/user1/myPython/

 

It seems that PyCharm does not like working on individual files. The files have to be a part of a project. People learning Python don't have projects.

 

To make the error message go away, I had to create a new project in the location /home/users1/myPython/.  Click Yes to the message The directory '/home/user1/myPython' is not empty. Would you like to create a project from existing sources instead? 

 

 

0
Comment actions Permalink

Yes, PyCharm usually works with projects, and you selected the best way: create a project from the existing directory. If you don't work with big projects with many files yet, you can learn Python in integrated Python Console within PyCharm, or try PyCharm Edu (Educational edition), which is free and open-source.

0

Please sign in to leave a comment.