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

locals()["__version__"] during installation on windows 11 with mingw64 #74

Open
mdzaebel opened this issue Dec 16, 2024 · 2 comments
Open

Comments

@mdzaebel
Copy link

I get the following error during installation. Could you update revised instructions or show a workaround here?

locals()["version"] is an outdated practice and likely a bug in the package. Modern Python packaging tools like setuptools or poetry no longer require this approach, as versions are often managed directly in pyproject.toml or similar files.

$ pip install 'useful-moonshine[tensorflow] @ git+https://github.com/usefulsensors/moonshine.git'
Collecting useful-moonshine@ git+https://github.com/usefulsensors/moonshine.git (from useful-moonshine[tensorflow]@ git+https://github.com/usefulsensors/moonshine.git)
  Cloning https://github.com/usefulsensors/moonshine.git to c:\users\marc.dzaebel\appdata\local\temp\pip-install-c9a2o6zt\useful-moonshine_c81ef10e52f54530b27fb21a7196c56a
  Running command git clone --filter=blob:none --quiet https://github.com/usefulsensors/moonshine.git 'C:\Users\marc.dzaebel\AppData\Local\Temp\pip-install-c9a2o6zt\useful-moonshine_c81ef10e52f54530b27fb21a7196c56a'
  Resolved https://github.com/usefulsensors/moonshine.git to commit 6a0846b556ca1c1f2f373996fe53b0b79e23cc17
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
  error: subprocess-exited-with-error

  python setup.py egg_info did not run successfully.
  exit code: 1

  [21 lines of output]
  C:\Users\marc.dzaebel\AppData\Local\Temp\pip-install-c9a2o6zt\useful-moonshine_c81ef10e52f54530b27fb21a7196c56a\setup.py:3: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    import pkg_resources
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
      exec(compile('''
      ~~~~^^^^^^^^^^^^
      # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      ...<31 lines>...
      exec(compile(setup_py_code, filename, "exec"))
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      ''' % ('C:\\Users\\marc.dzaebel\\AppData\\Local\\Temp\\pip-install-c9a2o6zt\\useful-moonshine_c81ef10e52f54530b27fb21a7196c56a\\setup.py',), "<pip-setuptools-caller>", "exec"))
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\Users\marc.dzaebel\AppData\Local\Temp\pip-install-c9a2o6zt\useful-moonshine_c81ef10e52f54530b27fb21a7196c56a\setup.py", line 15, in <module>
      version=read_version(),
              ~~~~~~~~~~~~^^
    File "C:\Users\marc.dzaebel\AppData\Local\Temp\pip-install-c9a2o6zt\useful-moonshine_c81ef10e52f54530b27fb21a7196c56a\setup.py", line 9, in read_version
      return locals()["__version__"]
             ~~~~~~~~^^^^^^^^^^^^^^^
  KeyError: '__version__'
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

Encountered error while generating package metadata.
@keveman
Copy link
Contributor

keveman commented Dec 17, 2024

@mdzaebel Thanks for filing the issue. I am looking at how best to fix this, will update as soon as I have a solution.

@jambalaya1
Copy link

Seeing this on MacOS as well. Any workarounds for the time being?

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