django-haystack

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. when installing django-haystack


[root@izj6c4tgce8abugvzaupm7z project_name]# pipenv install django-haystack

Installing django-haystack...
Error:  An error occurred while installing django-haystack!
Error text: Looking in indexes: https://pypi.python.org/simple
Collecting django-haystack
  Using cached django-haystack-3.0.tar.gz (450 kB)

    ERROR: Command errored out with exit status 1:
     command: /root/.local/share/virtualenvs/stdworkflow-yjFasZlk/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ac13_sr7/django-haystack/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ac13_sr7/django-haystack/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-_1nzjnvl
         cwd: /tmp/pip-install-ac13_sr7/django-haystack/
    Complete output (33 lines):
    WARNING: The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host mirrors.aliyun.com'.
    ERROR: Could not find a version that satisfies the requirement setuptools_scm (from versions: none)
    ERROR: No matching distribution found for setuptools_scm
    Traceback (most recent call last):
      File "/root/.local/share/virtualenvs/stdworkflow-yjFasZlk/lib/python3.7/site-packages/setuptools/installer.py", line 126, in fetch_build_egg
        subprocess.check_call(cmd)
      File "/usr/local/python3/lib/python3.7/subprocess.py", line 347, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/root/.local/share/virtualenvs/stdworkflow-yjFasZlk/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmptx16e019', '--quiet', '--index-url', 'http://mirrors.aliyun.com/pypi/simple/', 'setuptools_scm']' returned non-zero exit status 1.
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-ac13_sr7/django-haystack/setup.py", line 65, in <module>
        test_suite="test_haystack.run_tests.run_all",
      File "/root/.local/share/virtualenvs/stdworkflow-yjFasZlk/lib/python3.7/site-packages/setuptools/__init__.py", line 152, in setup
        _install_setup_requires(attrs)
      File "/root/.local/share/virtualenvs/stdworkflow-yjFasZlk/lib/python3.7/site-packages/setuptools/__init__.py", line 147, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/root/.local/share/virtualenvs/stdworkflow-yjFasZlk/lib/python3.7/site-packages/setuptools/dist.py", line 676, in fetch_build_eggs
        replace_conflicting=True,
      File "/root/.local/share/virtualenvs/stdworkflow-yjFasZlk/lib/python3.7/site-packages/pkg_resources/__init__.py", line 766, in resolve
        replace_conflicting=replace_conflicting
      File "/root/.local/share/virtualenvs/stdworkflow-yjFasZlk/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1049, in best_match
        return self.obtain(req, installer)
      File "/root/.local/share/virtualenvs/stdworkflow-yjFasZlk/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1061, in obtain
        return installer(requirement)
      File "/root/.local/share/virtualenvs/stdworkflow-yjFasZlk/lib/python3.7/site-packages/setuptools/dist.py", line 732, in fetch_build_egg
        return fetch_build_egg(self, req)
      File "/root/.local/share/virtualenvs/stdworkflow-yjFasZlk/lib/python3.7/site-packages/setuptools/installer.py", line 128, in fetch_build_egg
        raise DistutilsError(str(e)) from e
    distutils.errors.DistutilsError: Command '['/root/.local/share/virtualenvs/stdworkflow-yjFasZlk/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmptx16e019', '--quiet', '--index-url', 'http://mirrors.aliyun.com/pypi/simple/', 'setuptools_scm']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

the pipenv install command have worked very well before, but today it gives this error message. Does anyone know this issue?

I also tried to install other packages to test if it's a problem of the package or the source, for example, pipenv install numpy, but still, it gives me the same error messages.


Solution

  • Sorry I'm back, I solved my problem just now, I should have if I searched longer. This works for my problem:

    cd project_name
    
    pipenv install setuptools_scm
    pipenv install django-haystack
    

    although I don't know the reason, but a setuptools_scm package is needed.