tomaroberts / nii2dcm

nii2dcm: NIfTI to DICOM creation with Python
Other
56 stars 14 forks source link

git exception after pip install #31

Closed x1y9 closed 7 months ago

x1y9 commented 8 months ago

I get this exception when run nii2dcm under windows after pip install:

nTraceback (most recent call last):
  File "D:\tools\WPy64-39100\python-3.9.10.amd64\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "D:\tools\WPy64-39100\python-3.9.10.amd64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "D:\tools\WPy64-39100\python-3.9.10.amd64\Scripts\nii2dcm.exe\__main__.py", line 4, in <module>
  File "D:\tools\WPy64-39100\python-3.9.10.amd64\lib\site-packages\nii2dcm\__main__.py", line 9, in <module>
    from nii2dcm._version import __version__
  File "D:\tools\WPy64-39100\python-3.9.10.amd64\lib\site-packages\nii2dcm\_version.py", line 2, in <module>
    __version__ = Version.from_git().serialize(metadata=False, style=Style.SemVer)
  File "D:\tools\WPy64-39100\python-3.9.10.amd64\lib\site-packages\dunamai\__init__.py", line 1058, in from_git
    _detect_vcs(vcs)
  File "D:\tools\WPy64-39100\python-3.9.10.amd64\lib\site-packages\dunamai\__init__.py", line 355, in _detect_vcs
    raise RuntimeError(
RuntimeError: This does not appear to be a Git project

seems the version is detect from current git directory and get a git exception?

jcohen02 commented 8 months ago

Hi @x1y9, I may be wrong but this looks to be a bug in the 0.1.2 release package.

There are a few options/workarounds:

Hope that helps. I'll open an issue to investigate/resolve this issue.

tomaroberts commented 8 months ago

@x1y9 – sorry about this, I've not tested nii2dcm much in Windows yet! It's on the TODO list.

@jcohen02 – thanks for the input! Much appreciated.

jcohen02 commented 8 months ago

(This looks to be a duplicate (at least in part) of #30.) The workarounds described above should work to address the initial part of the problem reported in #30 but it looks like there may be a second problem highlighted there too.

tomaroberts commented 7 months ago

Fixed by #33

tomaroberts commented 7 months ago

@x1y9 – thanks for raising this issue. It should hopefully be fixed with latest version 0.1.5.