- This topic has 2 replies, 2 voices, and was last updated 1 year, 9 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Home › Forums › FABRIC General Questions and Discussion › upload_file error: No such file or directory
I’m working on the Upload and Execute in Jupyter Lab. I am able to create a slice and a node. But when I’m trying to upload a local file to the node, I receive an error message saying
Exception: [Errno 2] No such file or directory: ‘/Users/wangmeng/Documents/some_folder_names/myScript.sh’
And here’s the code I wrote
try:
node = slice.get_node(name=”Node1″)result = node.upload_file(‘/Users/wangmeng/Documents/some_folder_names/myScript.sh’, ‘myScript.sh’)
except Exception as e:
print(f”Exception: {e}”)
I have read an earlier post in the forum and learned that the first argument for upload_file should be the local path of the file, while the second argument is the path to the remote node. I’m not sure if I have formatted it correctly.
The script file that I’m trying to upload is read&write accessible to everyone.
That looks correct.
Are you able to open and read the file directly in the code?
It looks like you are running this on a Mac. Are you running it in a virtual environment on the Mac? In some cases a virtual environment will not be able to access files outside of the virtual environment.
Try opening and reading the file directly.
Thank you Paul for pointing that out. I realize that I had a misunderstanding about the concept of local. I thought it means my local drive, but what it actually means is the virtual environment. I am able to upload the file after uploading the file from my local drive to the VM. Thanks for the help!