6

I’m trying to install setup.py (from the website: https://github.com/richpsharp/ipbes-analysis/tree/1.1.0/ipbes-ndr) in the python virtual environment 3.7 (named “py37”).

I typed in:

  1. git clone https://github.com/richpsharp/ipbes-analysis.git
  2. cd ipbes-analysis\ipbes-ndr
  3. python setup.py install

However, I got the error:

C:\Users\86134>activate py37
(py37) C:\Users\86134>cd ipbes-analysis\ipbes-ndr
(py37) C:\Users\86134\ipbes-analysis\ipbes-ndr>python setup.py install
Traceback (most recent call last):
  File "setup.py", line 26, in <module>
    language="c++",
  File "F:\Anaconda3\envs\py37\lib\site-packages\setuptools\__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "F:\Anaconda3\envs\py37\lib\distutils\core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "F:\Anaconda3\envs\py37\lib\site-packages\setuptools\dist.py", line 433, in __init__
    k: v for k, v in attrs.items()
  File "F:\Anaconda3\envs\py37\lib\distutils\dist.py", line 292, in __init__
    self.finalize_options()
  File "F:\Anaconda3\envs\py37\lib\site-packages\setuptools\dist.py", line 708, in finalize_options
    ep(self)
  File "F:\Anaconda3\envs\py37\lib\site-packages\setuptools\dist.py", line 715, in _finalize_setup_keywords
    ep.load()(self, ep.name, value)
  File "F:\Anaconda3\envs\py37\lib\site-packages\setuptools_scm\integration.py", line 26, in version_keyword
    dist.metadata.version = _get_version(config)
  File "F:\Anaconda3\envs\py37\lib\site-packages\setuptools_scm\__init__.py", line 173, in _get_version
    parsed_version = _do_parse(config)
  File "F:\Anaconda3\envs\py37\lib\site-packages\setuptools_scm\__init__.py", line 142, in _do_parse
    "use git+https://github.com/user/proj.git#egg=proj" % config.absolute_root
LookupError: setuptools-scm was unable to detect version for 'C:\\Users\\86134\\ipbes-analysis\\ipbes-ndr'.

Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.

For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj

The contents of setup.py are:

"""setup.py module for ipbes_ndr_analysis module."""
from Cython.Build import cythonize
import numpy
from setuptools.extension import Extension
from setuptools import setup

setup(
    name='ipbes ndr analysis',
    packages=[
        'ipbes_ndr_analysis',
    ],
    package_dir={
        'ipbes_ndr_analysis': 'src/ipbes_ndr_analysis'
    },

    use_scm_version={
        'version_scheme': 'post-release',
        'local_scheme': 'node-and-date'},
    setup_requires=['setuptools_scm', 'cython', 'numpy'],
    include_package_data=True,
    ext_modules=cythonize(
        [Extension(
            "ipbes_ndr_analysis_cython",
            sources=["src/ipbes_ndr_analysis/ipbes_ndr_analysis_cython.pyx"],
            include_dirs=[numpy.get_include()],
            language="c++",
        )],
        )
)

I'm not sure how to fix this error...Any help would be appreciated. Thanks!!

Yuqi

gerrit
  • 24,025
  • 17
  • 97
  • 170
Yuqi
  • 61
  • 1
  • 2
  • 1
    If you [solved](https://github.com/richpsharp/ipbes-analysis/issues/1#issuecomment-800951870) the problem could you please write how — both here and there? – phd Mar 17 '21 at 13:54
  • 2
    Sure! This problem has been solved. Here's the solution: https://github.com/pypa/setuptools_scm/issues/536 – Yuqi Mar 17 '21 at 22:14

0 Answers0