NamedTemporaryFile function under windows
See original GitHub issueHi, I tried to run the MUV inotebook and got some errors with
[Errno 13] Permission denied
when trying to read or write from temp file.
I found the error online with the solution
http://zachmoshe.com/2017/04/03/pickling-keras-models.html
And adding delete=False to the 4 instances of NamedTemporaryFile in the file deepchem\hyper_init_.py from
tempfile.NamedTemporaryFile()
to
tempfile.NamedTemporaryFile(delete=False)
solved the problem.
However I don’t know if this option will break the module to run on Linux, and also if this is desirable (default is to delete the file) See https://docs.python.org/3.5/library/tempfile.html#tempfile.NamedTemporaryFile for the doc on NamedTemporaryFile and the windows/Linux behaviour
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:8 (4 by maintainers)
Top Results From Across the Web
What is NamedTemporaryFile useful for on Windows?
It states that accessing it a second time while it is still open. You can still use the name otherwise, just be sure...
Read more >tempfile — Generate temporary files and directories — Python ...
This module creates temporary files and directories. It works on all supported platforms. TemporaryFile , NamedTemporaryFile , TemporaryDirectory , and ...
Read more >tempfile – Create temporary filesystem resources. - PyMOTW
The NamedTemporaryFile() function creates a file with a name, accessed from the name attribute. import os import tempfile temp = tempfile.NamedTemporaryFile ...
Read more >Python tempfile module - GeeksforGeeks
The NamedTemporaryFile() function creates a file with a name, accessed from the name attribute. First import tempfile and then the file is ...
Read more >18744 (NamedTemporaryFile opened in read mode cannot be ...
The documentation for NamedTemporaryFile says that it exists so that on Windows so other ... My guess is that this will take some...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Still doesn’t work. Tested on Windows 11
Can confirm it still doesn’t work on windows 10. I had to add delete=False to tempfile.NamedTemporaryFile()