FileNotFoundError: Cannot find scripts/simple_collectible/deploy_simple.py

Hello I constantly get this error, I’ve tried several times but it still popping up.

1 Like

I do not know if it is because users name is “henry rosales” and because of the missing space is not available to get the files.

Hi @henryf10h, and welcome to the Infura community!

It looks like Python is having trouble finding the file you’re referencing here (deploy_simple.py) within the scripts/simple_collectible folder. I would check in to that folder to make sure the file exists. You can also check this blog post out for more help with fixing the error.

When you specify the file name “filename.ext” while read file, you are providing the open() function with a relative path. This means that the file you want to read is located in the current working directory.

file = open('filename.ext') //relative path

In the above code, you are not giving the full path to a file to the open() function, just its name - a relative path. The error “FileNotFoundError: [Errno 2] No such file or directory” is telling you that there is no file of that name in the working directory. So, try using the exact, or absolute path.

file = open(r'C:\path\to\your\filename.ext') //absolute path

In the above code, all of the information needed to locate the file is contained in the path string - absolute path.

If the full path to the file is not provided, the python file path is interpreted relative to the current working directory. This is the directory from which the program was started. For this to work, the directory containing the python executable must be in the PATH environment variable, which contains directories automatically searched for executables when a command is entered. To access a file in a different directory, you must either specify a relative path between the files or use an absolute path for one of them.