tdgrant1 / denss

Calculate electron density from a solution scattering profile
GNU General Public License v3.0
31 stars 22 forks source link

Running denss.all.py on Windows throws FileNotFoundError: [Errno 2] No such file or directory: 'path/to/file/cahd_final.log' #24

Closed ostannick closed 3 years ago

ostannick commented 3 years ago

I am trying to do create an ensemble of 20 structures for averaging using denss.all.py, but when I run it, I get the following issue:

λ py build\scripts-3.9\denss.all.py -f data/APS_June/cahd.out

C:\denss\denss (master -> origin)
λ py build\scripts-3.9\denss.all.py -f data/APS_June/cahd.out
data/APS_June/cahd_1
Traceback (most recent call last):
  File "C:\denss\denss\build\scripts-3.9\denss.all.py", line 149, in <module>
    fh = logging.FileHandler(fname)
  File "C:\Python39\lib\logging\__init__.py", line 1146, in __init__
    StreamHandler.__init__(self, self._open())
  File "C:\Python39\lib\logging\__init__.py", line 1175, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding,
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\denss\\denss\\data\\APS_June\\cahd_1\\data\\APS_June\\cahd_final.log'

I have managed to run denss.py by itself just fine and load up the volumes in PyMol. Cool stuff. Very interested to try ensemble averaging but it doesn't seem to work on windows.

Best

tdgrant1 commented 3 years ago

I tried this on my own Windows VM, and I was able to reproduce your error, but only when giving it the path. It works fine for me if the input file is in the same directory, but. It has something to do with the logging module messing up the path on Windows is seems. I'll see if I can come up with a fix, but for now I would recommend running denss.all.py in the same directory as the .out file you're using.

tdgrant1 commented 3 years ago

I have just pushed a bug fix here. This fixes the filename issue when a path is given. This was not just a Windows issue as I initially thought. Let me know if that works for you.