Mmdetection: Error when pip install mmcv: Could not find a version that satisfies the requirement Cython (from versions: none)

Created on 26 Dec 2019  Â·  4Comments  Â·  Source: open-mmlab/mmdetection

I'm trying to install mmdetection, following the INSTALL.md instruction.
Nothing goes wrong before command 'pip install mmcv'. I checked pytorch by 'torch.cuda.is_available()' and receive a True. I'm in conda environment 'open-mmlab'. And mmdetection is already downloaded there.
When I run 'pip install mmcv', I got following error:

Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting mmcv
  Downloading http://mirrors.aliyun.com/pypi/packages/9b/7c/f6c20b54bb22d47cb87cc48ee626aab290584458e38bc1bbb76c868afc82/mmcv-0.2.15.tar.gz (49kB)
     |████████████████████████████████| 51kB 2.3MB/s
    ERROR: Command errored out with exit status 1:
     command: /home/amax/anaconda3/envs/open-mmlab-sfy/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9zs6r6qn/mmcv/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9zs6r6qn/mmcv/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-install-9zs6r6qn/mmcv/pip-egg-info
         cwd: /tmp/pip-install-9zs6r6qn/mmcv/
    Complete output (29 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 Cython (from versions: none)
    ERROR: No matching distribution found for Cython
    Traceback (most recent call last):
      File "/home/amax/anaconda3/envs/open-mmlab-sfy/lib/python3.7/site-packages/setuptools/installer.py", line 128, in fetch_build_egg
        subprocess.check_call(cmd)
      File "/home/amax/anaconda3/envs/open-mmlab-sfy/lib/python3.7/subprocess.py", line 363, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/home/amax/anaconda3/envs/open-mmlab-sfy/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmp41_hkpqt', '--quiet', 'Cython']' returned non-zero exit status 1.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-9zs6r6qn/mmcv/setup.py", line 9, in <module>
        dist.Distribution().fetch_build_eggs(['Cython', 'numpy>=1.11.1'])
      File "/home/amax/anaconda3/envs/open-mmlab-sfy/lib/python3.7/site-packages/setuptools/dist.py", line 721, in fetch_build_eggs
        replace_conflicting=True,
      File "/home/amax/anaconda3/envs/open-mmlab-sfy/lib/python3.7/site-packages/pkg_resources/__init__.py", line 782, in resolve
        replace_conflicting=replace_conflicting
      File "/home/amax/anaconda3/envs/open-mmlab-sfy/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1065, in best_match
        return self.obtain(req, installer)
      File "/home/amax/anaconda3/envs/open-mmlab-sfy/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1077, in obtain
        return installer(requirement)
      File "/home/amax/anaconda3/envs/open-mmlab-sfy/lib/python3.7/site-packages/setuptools/dist.py", line 777, in fetch_build_egg
        return fetch_build_egg(self, req)
      File "/home/amax/anaconda3/envs/open-mmlab-sfy/lib/python3.7/site-packages/setuptools/installer.py", line 130, in fetch_build_egg
        raise DistutilsError(str(e))
    distutils.errors.DistutilsError: Command '['/home/amax/anaconda3/envs/open-mmlab-sfy/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmp41_hkpqt', '--quiet', 'Cython']' 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.

I doubt the critical error is ERROR: Could not find a version that satisfies the requirement Cython (from versions: none), which, I think, indicates that there's no 'Cython' in my environment.
Should I firstly run something like conda install Cython? Since it's somewhat dangerous to try fixing an error blindly, I'm here to ask for suggestion and help. Thanks~

Most helpful comment

Fine... I installed cython, then met similar problem with pytest and pytest-runner, just installed them all.
Now mmcv succesfully built. Problem seems solved.

All 4 comments

Fine... I installed cython, then met similar problem with pytest and pytest-runner, just installed them all.
Now mmcv succesfully built. Problem seems solved.

Fine... I installed cython, then met similar problem with pytest and pytest-runner, just installed them all.
Now mmcv succesfully built. Problem seems solved.
所以怎么解决的呢

Fine... I installed cython, then met similar problem with pytest and pytest-runner, just installed them all.
Now mmcv succesfully built. Problem seems solved.
所以怎么解决的呢

就缺什么就conda install或者pip install就好了

谢谢兄弟,终于有用了

Was this page helpful?
0 / 5 - 0 ratings