1. upload_file error: No such file or directory

upload_file error: No such file or directory

Home Forums FABRIC General Questions and Discussion upload_file error: No such file or directory

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3758
    Meng Wang
    Participant

      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.

      #3771
      Paul Ruth
      Keymaster

        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.

        #3774
        Meng Wang
        Participant

          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!

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.