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

ERROR when import mumax3c: 'Invalid version: '-PKG-VERSION' #254

Closed
liuziheng2010 opened this issue Aug 31, 2023 · 1 comment · Fixed by ubermag/mumax3c#71
Closed

ERROR when import mumax3c: 'Invalid version: '-PKG-VERSION' #254

liuziheng2010 opened this issue Aug 31, 2023 · 1 comment · Fixed by ubermag/mumax3c#71

Comments

@liuziheng2010
Copy link

liuziheng2010 commented Aug 31, 2023

Dear ubermag team:

I have successfully installed ubermag on my PC with Windows 10 OS, and run some simulations using docker oommfc runner completely.

CUDA and available mumax3 software have already been installed, I followed the guides in https://ubermag.github.io/installation.html and add the directory containing the mumax3 executable to my PATH variable.

There is an ERROR when I import mumax3c. Please help me with this ERROR, THANKS a lot!

InvalidVersion                            Traceback (most recent call last)
Cell In[1], line 3
      1 import discretisedfield as df
      2 import micromagneticmodel as mm
----> 3 import mumax3c as mc
      4 #import oommfc as oc
      5 import math

File ~\anaconda3\envs\ubermag_env\lib\site-packages\mumax3c\__init__.py:60
     54     return pytest.main(
     55         ["-m", "docker", "-v", "--pyargs", "mumax3c"]
     56     )  # pragma: no cover
     59 __version__ = pkg_resources.get_distribution(__name__).version
---> 60 __dependencies__ = pkg_resources.require(__name__)

File ~\anaconda3\envs\ubermag_env\lib\site-packages\pkg_resources\__init__.py:966, in WorkingSet.require(self, *requirements)
    957 def require(self, *requirements):
    958     """Ensure that distributions matching `requirements` are activated
    959 
    960     `requirements` must be a string or a (possibly-nested) sequence
   (...)
    964     included, even if they were already activated in this working set.
    965     """
--> 966     needed = self.resolve(parse_requirements(requirements))
    968     for dist in needed:
    969         self.add(dist)

File ~\anaconda3\envs\ubermag_env\lib\site-packages\pkg_resources\__init__.py:827, in WorkingSet.resolve(self, requirements, env, installer, replace_conflicting, extras)
    824 if not req_extras.markers_pass(req, extras):
    825     continue
--> 827 dist = self._resolve_dist(
    828     req, best, replace_conflicting, env, installer, required_by, to_activate
    829 )
    831 # push the new requirements onto the stack
    832 new_requirements = dist.requires(req.extras)[::-1]

File ~\anaconda3\envs\ubermag_env\lib\site-packages\pkg_resources\__init__.py:852, in WorkingSet._resolve_dist(self, req, best, replace_conflicting, env, installer, required_by, to_activate)
    849 if dist is None:
    850     # Find the best distribution and add it to the map
    851     dist = self.by_key.get(req.key)
--> 852     if dist is None or (dist not in req and replace_conflicting):
    853         ws = self
    854         if env is None:

File ~\anaconda3\envs\ubermag_env\lib\site-packages\pkg_resources\__init__.py:3204, in Requirement.__contains__(self, item)
   3199     item = item.version
   3201 # Allow prereleases always in order to match the previous behavior of
   3202 # this method. In the future this should be smarter and follow PEP 440
   3203 # more accurately.
-> 3204 return self.specifier.contains(item, prereleases=True)

File ~\anaconda3\envs\ubermag_env\lib\site-packages\pkg_resources\_vendor\packaging\specifiers.py:902, in SpecifierSet.contains(self, item, prereleases, installed)
    900 # Ensure that our item is a Version instance.
    901 if not isinstance(item, Version):
--> 902     item = Version(item)
    904 # Determine if we're forcing a prerelease or not, if we're not forcing
    905 # one for this particular filter call, then we'll use whatever the
    906 # SpecifierSet thinks for whether or not we should support prereleases.
    907 if prereleases is None:

File ~\anaconda3\envs\ubermag_env\lib\site-packages\pkg_resources\_vendor\packaging\version.py:197, in Version.__init__(self, version)
    195 match = self._regex.search(version)
    196 if not match:
--> 197     raise InvalidVersion(f"Invalid version: '{version}'")
    199 # Store the parsed out pieces of the version
    200 self._version = _Version(
    201     epoch=int(match.group("epoch")) if match.group("epoch") else 0,
    202     release=tuple(int(i) for i in match.group("release").split(".")),
   (...)
    208     local=_parse_local_version(match.group("local")),
    209 )

InvalidVersion: Invalid version: '-PKG-VERSION'
@samjrholt samjrholt linked a pull request Sep 1, 2023 that will close this issue
@samjrholt
Copy link
Member

@liuziheng2010 thank you for bringing this to our attention. We have corrected this and the updated code will be released with the next version of ubermag. We are hoping to release in approximately 2 weeks time.

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

Successfully merging a pull request may close this issue.

2 participants