Warning: Name is nonexistent or not a directory

Every time I start up MATLAB, I receive this message:
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox\mexw32.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox\special.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox\sift.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox\plotop.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox\mser.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox\misc.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox\kmeans.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox\imop.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox\geometry.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox\aib.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox.
Warning: Name is nonexistent or not a directory: xml_toolbox.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\Hand_Mathias\videoIO.
How do I fix this?

10 件のコメント

Kevin Claytor
Kevin Claytor 2012 年 7 月 4 日
Does the folder "C:\POSTDOC\vlfeat\toolbox\" exist on the machine? If you no longer want/need/have that path, it may still be referenced in you path variables, go to File->Set Path to find and remove the entries, or they may be referenced in a startup.m file, which you'll have to search for and modify.
Jonathan
Jonathan 2012 年 7 月 5 日
None of these directories exist on the machine. When I try to edit the startup.m file, it tells me that startup.m does not exist.
Lue XIONG
Lue XIONG 2020 年 11 月 19 日
Dear all programmer,
Please help me, how to solve this problem as the paste below:
In addpath (line 86)
In startup (line 2)
Warning: Name is nonexistent or not a directory: D:\solvers\cvx
> In path (line 109)
In addpath (line 86)
In startup (line 3)
Warning: Executing startup failed in matlabrc.
This indicates a potentially serious problem in your MATLAB setup, which should be resolved as soon as possible. Error detected was:
MATLAB:UndefinedFunction
Unrecognized function or variable 'cvx_setup'.
Image Analyst
Image Analyst 2020 年 11 月 19 日
Looks like your startup.m file is trying to cd to D:\solvers\cvx and that folder does not exist. Remmove line 2 from start.m and save it and then run it. It should not NOT try to go to that folder, and perhaps complete the rest of your startup.m code successfully.
Simon Dawson
Simon Dawson 2021 年 4 月 26 日
I was getting the same issue along with a crash almost immediately. I mean within a handful of seconds. This was upon updating to r2021a on Mac OS from r2020b.
I fixed it by locating the pathdef.m file, moving it to the trash and everything is now happy again.
Image Analyst
Image Analyst 2021 年 4 月 26 日
@Simon Dawson, that is basically what restoredefaultpath does, except that restoredefaultpath doesn't require you to locate the file.
Simon Dawson
Simon Dawson 2021 年 4 月 26 日
Yes, agreed. But, the near instantaneous crash would not allow me time to get the restoredefaultpath savepath in before it went kerboom. =>
Image Analyst
Image Analyst 2021 年 4 月 26 日
@Simon Dawson, So you had MATLAB itself crash and go away and you didn't even get a command window? Like MATLAB just shuts down and you aren't even left with a command window with red error messages in it? That's very serious and the Mathworks would want to know about it. It should just throw error messages and still be alive.
Simon Dawson
Simon Dawson 2021 年 4 月 26 日
I launched Matlab. I got a whole set of "Warning: Name is nonexistent or not a directory:" messages. I pasted in the restore path and save path commands but it would always immediately crash like in <5 seconds and go away altogether. The only thing left was the error dialog box asking to send a crah report to Mathworks which I duly did maybe half a dozen times. Pressing send or ok on that meant that went away and so I was matlab free in terms of running applications. Restarted the Mac and it had the same pathology. So, pathdef to trash and then it was fine. I now have to add back my custom paths.
Image Analyst
Image Analyst 2021 年 4 月 27 日
@Simon Dawson, since you got an official crash report and MATLAB itself shutdown, it was a real crash and the Mathworks should be contacting you by email with some response.

サインインしてコメントする。

 採用された回答

Image Analyst
Image Analyst 2012 年 7 月 4 日
編集済み: Image Analyst 2022 年 12 月 7 日

37 投票

METHOD #1
If there are some folders in the path you'd still like to keep on the path, and just remove the one folder that it is complaining about,
  1. Go to the "Home" tab of the tool ribbon,
  2. Click the SetPath icon.
  3. Then locate the missing folder(s) and highlight them.
  4. Click Remove, Save, and Close.
You should not see the missing folders listed the next time you start MATLAB. I think this is the preferred method.
-------------------------------------------------------------------------------------------------------------------------------------------------
METHOD #2
If you'd rather do it by fixing the file in an editor window, instead of simply doing it via the toolbar button meant for this, then you can edit pathdef.m
>> edit pathdef.m
Then search for and locate the bad folder, delete that line in the file, and save the file. You should not see the missing folders listed the next time you start MATLAB.
If NEITHER of the above two methods work, then check your startup.m file by typing "edit startup.m" on the command line. See if everything looks fine there (i.e., there are no calls to addpath with non-existent folders). If non-existent folders are added to the path in your startup.m file, remove them.
-------------------------------------------------------------------------------------------------------------------------------------------------
METHOD #3
Finally, as a last resort, you can issue the line
restoredefaultpath
savepath
to get back to initial "right out of the box" conditions just as if you'd reinstalled MATLAB. This will remove any folders that you have added to the search path after you installed MATLAB and get you back to the original default path.

10 件のコメント

Jonathan
Jonathan 2012 年 7 月 5 日
When I enter edit startup.m, it tells me that startup.m does not exist.
Albert Yam
Albert Yam 2012 年 7 月 5 日
You can also get to the pathing through
File > Set Path..
and manually remove (or default) the pathing there.
Image Analyst
Image Analyst 2012 年 7 月 5 日
Did you try restoredefaultpath? If so, I'm surprised that didn't fix it. Since this is an installation/startup issue, I think the Mathworks will give you free telephone help on it.
Alexandra Braig
Alexandra Braig 2020 年 11 月 16 日
I had the same problem. Your solution (restoredefaultpath; savepath) worked. After setting the path at the next run the warnings did not appear again. Thank you!
David Walker
David Walker 2021 年 1 月 5 日
I had the same problem as well and could not see the paths in Set Path so I could not delete them there. Your solution worked great for me. Thank you!
Lisa Hailey
Lisa Hailey 2021 年 2 月 4 日
Thank you, fixed it!
Abdullah bin Amin
Abdullah bin Amin 2021 年 3 月 31 日
Thank You, Greatfull
I Fixed it.
Rastislav Lagana
Rastislav Lagana 2021 年 10 月 25 日
Thank you too. The last resort helped.
Mehdi Dehghan
Mehdi Dehghan 2022 年 12 月 7 日
Thank you for this comment. It was great.
Bryan Mackey
Bryan Mackey 2023 年 7 月 19 日
Thanks. Interesting that the set path window did not contain my defective path; however, the pathdef.m file did. Simple edit and it's fixed.

サインインしてコメントする。

その他の回答 (10 件)

Srichakradhar Reddy Nagireddy
Srichakradhar Reddy Nagireddy 2013 年 11 月 11 日

84 投票

>> edit pathdef.m
  • Remove the directories that are causing the error.
  • Save the file and restart matlab, you will notice that you no longer have the error.

17 件のコメント

Michael
Michael 2014 年 2 月 10 日
Good tip.
With mine, the two offending directories were at the top of the list. I couldn't find them via the normal Set path menu.
Thanks!
TG
TG 2014 年 4 月 30 日
easiest way to do this. Thanks!
Gordon
Gordon 2015 年 7 月 2 日
This has been bugging me for a while. This fixed it. Thanks for posting this!
Fat Dragon
Fat Dragon 2015 年 11 月 19 日
That's it! Thanks!
Walter Roberson
Walter Roberson 2017 年 5 月 22 日
Laercio Barbosa comments to Srichakradhar Reddy Nagireddy:
William Cressler
William Cressler 2017 年 7 月 2 日
I had the same problem and this is the only answer that worked for me without having to resort to restoredefaultpath. Thanks for posting
Walter Roberson
Walter Roberson 2017 年 7 月 3 日
You can also use pathtool to edit the path.
Shuya Zhong
Shuya Zhong 2020 年 5 月 18 日
Also solved my problem.
I have changed the initial working folder when MATLAB starts but still had the error. After trying your way, it totally solved my problem. Thanks!
Kepler
Kepler 2020 年 10 月 5 日
very good solution!
the bad path is not in the "set path" GUI but still in "pathdef.m".
Warwick
Warwick 2020 年 11 月 29 日
thanks very much. simple and effective process.
asd asd
asd asd 2021 年 3 月 20 日
thanksssssss!!!!
sana bilal
sana bilal 2021 年 5 月 8 日
Thanks a Million I had the same issue
Image Analyst
Image Analyst 2021 年 5 月 8 日
編集済み: Image Analyst 2021 年 5 月 8 日
@sana bilal, you can also do this from the Set Path button like I mentioned in my answer. Just locate the problematic folder and delete it. If you do it that way, there is no need to restart MATLAB since it fixes it immediately.
Steven Lord
Steven Lord 2021 年 7 月 14 日
Hassan Sultan flagged this as "The best answer"
Please use comments to offer opinions about the answer. Flags are generally intended to alert people with editing privileges of spam or other violations of the MATLAB Answers rules that need to be reviewed.
DGM
DGM 2022 年 2 月 8 日
編集済み: DGM 2022 年 2 月 8 日
This actually works. Beats having to restore the defaults again and again. To clarify, using the pathtool() or rmpath() has never worked for me once this happens at startup. The offending directories are simply not displayed in pathtool, and rmpath claims that they aren't in the path file. It seems like the path file is checked at startup and any erroneous entries are simply not copied to what's in memory, and so the user has no means to fix it with those tools.
Danh Phí Thành
Danh Phí Thành 2022 年 11 月 2 日
This also worked for me!
Maurizio Bollini
Maurizio Bollini 2022 年 11 月 19 日
This worked for me, thanks.

サインインしてコメントする。

omid
omid 2018 年 4 月 6 日

3 投票

Go to File>set path> Defaults> save> close then restart matlab
JRMel
JRMel 2015 年 3 月 5 日
編集済み: JRMel 2015 年 3 月 5 日

0 投票

I am having a very similar problem. I get the error below every time I start matlab. I no longer have the crp toolbox. However, the problem paths are not listed when I go to File > Set Path or in pathdef.m
restoredefaultpath savepath --> This doesn't fix the problem
Here are the errors:

2 件のコメント

Image Analyst
Image Analyst 2015 年 3 月 5 日
Does that folder exist? Start a new question and attach your startup.m file. You're probably cd'ing to that folder and it's not there.
JRMel
JRMel 2015 年 3 月 7 日
Oh that actually helped me solve the problem! The startup file had a couple of addpath lines to those non-existing files. Thank you very much!

サインインしてコメントする。

Vicente
Vicente 2015 年 9 月 11 日

0 投票

I have a similar problem. When I first open MATLAB, I see those same warnings, name non existant or not a directory, but I know what's the cause. I have formatted my pc, and somehow Microsoft managed to change my computer User name from what it was previously. Now, I can't run any of my models. Can anyone help me with fixing this problem please?

1 件のコメント

Walter Roberson
Walter Roberson 2015 年 9 月 11 日
Vicente, consider making a shortcut or symbolic link for the old directory name to point to your current directory name.

サインインしてコメントする。

Manoj Shukla
Manoj Shukla 2020 年 4 月 1 日

0 投票

Hi Team,
Please provide the solution for step by step
I am having a very similar problem. I get the error below every time I start matlab. I no longer have the crp toolbox. However, the problem paths are not listed when I go to File > Set Path or in pathdef.m
restoredefaultpath savepath --> This doesn't fix the problem
Here are the errors: Offline & Online
>> submit()
Warning: Name is nonexistent or not a directory: C:\Users\lenovo\MATLAB Drive\.\lib
> In path (line 109)
In addpath (line 86)
In submit (line 2)
Warning: Name is nonexistent or not a directory: C:\Users\lenovo\MATLAB Drive\.\lib\jsonlab
> In path (line 109)
In addpath (line 86)
In submitWithConfiguration (line 2)
In submit (line 45)
'parts' requires one of the following:
Automated Driving Toolbox
Navigation Toolbox
Robotics System Toolbox
Sensor Fusion and Tracking Toolbox
Error in submitWithConfiguration (line 4)
parts = parts(conf);
Error in submit (line 45)
submitWithConfiguration(conf);
Thanks & Regards,
Manoj Shukla

2 件のコメント

Image Analyst
Image Analyst 2020 年 4 月 1 日
Open the files it tells you to and change any occurrence of "C:\Users\lenovo\MATLAB Drive" to some folder that you actually DO have.
Walter Roberson
Walter Roberson 2020 年 4 月 2 日
The code for some of the functions for submitWithConfiguration has some lines in which parts is a function, and also has some lines in which parts is a variable. Recent changes in the way MATLAB finds functions and variables say that when you use a single name as a function and a variable in the same routine, that MATLAB is permitted to assume that the name only refers to a variable, and then to complain when the variable does not yet exist at the time that the name was intended to be a function call. You need to edit the code so that uses some other variable name rather than parts

サインインしてコメントする。

Alp utku iyidilli
Alp utku iyidilli 2021 年 1 月 3 日

0 投票

Warning: Name is nonexistent or not a directory: C:\Users\maila\AppData\Local\Temp\Editor_yviar
Is my error when I run Matlab. I can't understand what the problem is. And plus as I was trying to
cd ~/Desktop
mkdir CONN_Demo
To learn functional connectivity on CONN-Toolbox, I had another problem:
"Cannot CD to C:\Users\maila\Documents\~\Desktop (Name is nonexistent or not a directory)."
Could you tell me what I should do as a non-programmer user?
Thank you in advance...

2 件のコメント

Walter Roberson
Walter Roberson 2021 年 1 月 3 日
For the first message see
For the other part:
You appear to be going through the tutorial https://andysbrainbook.readthedocs.io/en/latest/FunctionalConnectivity/CONN_ShortCourse/CONN_02_DataDownload.html which is written expecting that the user is using Mac (or possibly Linux). You will need to replace
cd ~/Desktop
with
cd C:\Users\maila\Desktop
In the place it says
movefile('~/Downloads/sub-01_func_sub-01_task-rest_bold.nii.gz', 'sub-01/func')
movefile('~/Downloads/sub-01_anat_sub-01_T1w.nii', 'sub-01/anat')
then instead of ~/Downloads you should give the path to the place you downloaded the .nii.gz and .nii files which might possibly be
movefile('C:\Users\maila\Downloads/sub-01_func_sub-01_task-rest_bold.nii.gz', 'sub-01/func')
movefile('C:\Users\maila/Downloads/sub-01_anat_sub-01_T1w.nii', 'sub-01/anat')
for your particular account -- here the maila refers to your account name which happened to be stated in the error message about C:\Users\maila\Documents\~\Desktop
Alp utku iyidilli
Alp utku iyidilli 2021 年 2 月 1 日
Thank you, I appreciate

サインインしてコメントする。

Maneesa Mustharif TP
Maneesa Mustharif TP 2021 年 6 月 6 日

0 投票

Warning: Function Warning: Name is nonexistent or not a directory: /MATLAB Drive/./lib
> In path (line 109)
In addpath (line 86)
In addpath (line 49)
In submit (line 2)
Warning: Function Warning: Name is nonexistent or not a directory: /MATLAB Drive/./lib/jsonlab
> In path (line 109)
In addpath (line 86)
In addpath (line 49)
In submitWithConfiguration (line 2)
In submit (line 45)
'parts' requires one of the following:
Automated Driving Toolbox
Navigation Toolbox
Robotics System Toolbox
Sensor Fusion and Tracking Toolbox
UAV Toolbox
Error in submitWithConfiguration (line 4)
parts = parts(conf);
Error in submit (line 45)
submitWithConfiguration(conf);
i have this error when i tried to submit my assignment on matlab.
can you find solution for this?
Walter Roberson
Walter Roberson 2021 年 6 月 6 日

0 投票

You need to get corrected code from the courseware system; if corrected code is not available, then the responses at the above link describe how to modify the code yourself.
Priya Priya
Priya Priya 2021 年 9 月 18 日

0 投票

Warning: Function Warning: Name is nonexistent or not a directory: /MATLAB Drive/./lib
> In path (line 109)
In addpath (line 86)
In addpath (line 49)
In submit (line 2)
Warning: Function Warning: Name is nonexistent or not a directory: /MATLAB Drive/./lib/jsonlab
> In path (line 109)
In addpath (line 86)
In addpath (line 49)
In submitWithConfiguration (line 2)
In submit (line 45)
Jose Hancco
Jose Hancco 2023 年 9 月 5 日

0 投票

I had the same problem. I've just open by console
open startup.m
and delete directories there. Then save the file and that's all.

1 件のコメント

Image Analyst
Image Analyst 2023 年 9 月 6 日
Yes -- you used method #2 in the Accepted answer.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by