简体   繁体   中英

Directory not found in Pycharm when running code

I get an error by running my code in pycharm. I get this message :

C:\\Python27\\python.exe: can't open file 'C:/Users/Melinda/PycharmProjects/untitled/classParticipant.py': [Errno 2] No such file or directory

Process finished with exit code 2 I understand that I don't have the Folder named untitled, because I have renamed it afterwards as Lab4. enter image description here

You've borked your project by renaming the directory yourself rather than renaming the project from within the IDE.

You need to close and delete the project (do not delete the files when it asks). If you feel unsure about this copy your files to a backup location first. Then reopen the project using "Open" from the file menu.

I wouldn't go that far to delete the project, have a go at going to

Settings -> Project -> Project Structure

and then removing and re-adding the project root.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM