Skip to content
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

git exception after pip install #31

Closed
x1y9 opened this issue Jan 24, 2024 · 5 comments
Closed

git exception after pip install #31

x1y9 opened this issue Jan 24, 2024 · 5 comments

Comments

@x1y9
Copy link

x1y9 commented Jan 24, 2024

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
Copy link
Collaborator

jcohen02 commented Jan 24, 2024

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:

  • you could install the previous release which looks like it doesn't have this issue - pip install nii2dcm==0.1.1,

  • or, if you want to use the latest version, I think installing from source by cloning the source code from GitHub and following the instructions under "building from source" at https://pypi.org/project/nii2dcm/ may avoid the problem.

  • or, if you're happy editing the code after you've installed via pip, you could edit the _version.py file in the nii2dcm directory and replace the line __version__ = Version.from_git().serialize(metadata=False, style=Style.SemVer) with __version__ = '0.1.2'. From the example you gave above, that file on your system should be at D:\tools\WPy64-39100\python-3.9.10.amd64\lib\site-packages\nii2dcm\_version.py.

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

@tomaroberts
Copy link
Owner

@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
Copy link
Collaborator

(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
Copy link
Owner

Fixed by #33

@tomaroberts
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants