Message Boards Message Boards

0
|
431 Views
|
3 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Error when set path from Insert path. Still does not work to import image on MAC OS 14.2.1

Posted 2 months ago

I keep getting a error message when I try to import something the directory path just will not work even with Insert Path. This is a big pain. What is happening I have no idea how to fix this problem and I cannot share the entire path because it will reveal my computer name. What can i do??

I can't do anything! To figure out so many things on programming because they are not obvious in the connection to language. They are "invisible".

POSTED BY: Zachary Wertz
3 Replies
Posted 2 months ago

Which command are you trying to use? Import? Get? Read? There is no InsertPath command, so what do you mean that it doesn't work with "Insert Path"?

It would be pretty easy to elide the computer name when you post the actual command you are trying to run, and seeing what you're actually trying would make it a lot easier to help.

POSTED BY: Eric Rimbey
Posted 2 months ago

Hello Eric,

Thanks for your reply,

I'm using Import[File path here by menu]

I got a syntax Error , I tried it again and it worked. I did not need backslash for spaces in the path. That was what I did first but second time I used the Menu bar to insert a file path. see below. That still did not work. I don't know why I must have made a change somehow. I tried it twice and it worked.

I mean on the top of the menu bar, "Insert" scroll down to the end to "File Path.." I used that to select the file to Import.

Problem Solved I guess! Thanks Eric.

POSTED BY: Zachary Wertz
Posted 2 months ago

Glad you figured out something that worked. For future reference, you might try...

  • Use the File Browser tool. If you type Import[, that should automatically create the close brace, so you'll have Import[] with the cursor between the braces. Now type " and it should automatically insert the close quotes, and you'll have Import[""] and also a little tooltip kind of thing that says "File Browser". Click on "File Browser" and you can navigate to the file you want. [I'm using version 14, but this functionality has existed for awhile, although I'm not sure exactly which versions support it.]
  • Use FileNameJoin. Rather than try to figure out the directory delimiters and escape characters yourself, let this function build the path name for you. So, some thing like Import[FileNameJoin[{$RootDirectory, "Users", "bob", "Desktop", "the photo.png"}]].
  • Use specially defined paths. If the file you want to import is in the same directory as the notebook you're working in, you can do this: Import[FileNameJoin[{NotebookDirectory[], "the photo.png"}]]. There are other defined constants, e.g. $HomeDirectory.
POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract