-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
matplotlib savefig limited to size of the path #17313
Comments
Does If not, then this is a Python/Windows issue and I'm not sure there's much we can do about it. |
I'm going to close this since it doesn't look like it is a Matplotlib issue - if you can reply to @QuLogic's comment above, or provide more info feel free to re-open this issue or open a new one! |
I have a similar problem. The length of the name of file or the parent directory needs to be short. Otherwise I get FileNotFoundError: [Errno 2] No such file or directory. I have tried saving in a different directory using the same filename and it worked fine. So the problem is not use of characters that cannot be used in filename. |
@apohali Please open a new issue with steps needed to reproduce the problem. However please check that a normal python file-open works. If not, we can't help. |
I got the same issue. After testing, the problem seems to be that the overall character amount in fname must be < 256 |
@qzdeng did you also try a normal file-open similar to #17313 (comment)? |
True, it is a Windows caused problem |
I have been trying to save a figure using matplotlib. The size of the path I specify to
plt.savefig
was too long. Specifically:The output of
os.path.join(output_folder, 'forecasts_scatter_%s.png' % model_name)
is:But I was getting the error:
I replaced this with:
and it worked.
The text was updated successfully, but these errors were encountered: