question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mmdet>=2.20.0 windows py38 can't install beacause of pycocotools

See original GitHub issue

Thanks for your error report and we appreciate it a lot.

Checklist

  1. I have searched related issues but cannot get the expected help.
  2. I have read the FAQ documentation but cannot get the expected help.
  3. The bug has not been fixed in the latest version.

Describe the bug mmdet>=2.20.0 need pycocotools but not accept pycocotools-windows. And it’s hard for me to build a pycocotools from source code. But I try mmdet==2.19.1, which accept pycocotools-windows and it can be easy installed with py38. So I think it is easy to fix, and I’d like to trian with cpu, so I need mmdet>=2.21.0, So I hope to fix this bug.

Reproduction

  1. What command or script did you run?
    pip install mmdet
    pip install mmdet==
    pip install mmdet==2.19.1(this one works, but not the latest version)
  1. Did you make any modifications on the code or config? Did you understand what you have modified?no

  2. What dataset did you use? no Environment

  3. Please run python mmdet/utils/collect_env.py to collect necessary environment information and paste it here.

C:\Users\Administrator\miniconda3\envs\py38\python.exe: can’t open file ‘mmdet/utils/collect_env.py’: [Errno 2] No such file or directory (beacause I use pip to install, not git) 3. You may add addition that may be helpful for locating the problem, such as - How you installed PyTorch [e.g., pip, conda, source] - Other environment variables that may be related (such as $PATH, $LD_LIBRARY_PATH, $PYTHONPATH, etc.) python3.8.12 mmcv1.4.5 torch1.8.1 no cuda no gpu Error traceback If applicable, paste the error trackback here.

(py38) PS C:\Users\Administrator> pip install mmdet==2.22.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting mmdet==2.22.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/66/61/0e03c564c04d3d84a2d4f6e218c1fa287e61955322dcaa943f66ec4fbae9/mmdet-2.22.0-py3-none-any.whl (1.3 MB)
     |████████████████████████████████| 1.3 MB 544 kB/s
Requirement already satisfied: six in c:\users\administrator\miniconda3\envs\py38\lib\site-packages (from mmdet==2.22.0) (1.16.0)
Collecting pycocotools
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/75/5c/ac61ea715d7a89ecc31c090753bde28810238225ca8b71778dfe3e6a68bc/pycocotools-2.0.4.tar.gz (106 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: matplotlib in c:\users\administrator\miniconda3\envs\py38\lib\site-packages (from mmdet==2.22.0) (3.5.1)
Requirement already satisfied: numpy in c:\users\administrator\miniconda3\envs\py38\lib\site-packages (from mmdet==2.22.0) (1.22.3)
Requirement already satisfied: terminaltables in c:\users\administrator\miniconda3\envs\py38\lib\site-packages (from mmdet==2.22.0) (3.1.10)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\administrator\miniconda3\envs\py38\lib\site-packages (from matplotlib->mmdet==2.22.0) (1.3.2)
Requirement already satisfied: pyparsing>=2.2.1 in c:\users\administrator\miniconda3\envs\py38\lib\site-packages (from matplotlib->mmdet==2.22.0) (3.0.7)
Requirement already satisfied: fonttools>=4.22.0 in c:\users\administrator\miniconda3\envs\py38\lib\site-packages (from matplotlib->mmdet==2.22.0) (4.30.0)
Requirement already satisfied: packaging>=20.0 in c:\users\administrator\miniconda3\envs\py38\lib\site-packages (from matplotlib->mmdet==2.22.0) (21.3)
Requirement already satisfied: cycler>=0.10 in c:\users\administrator\miniconda3\envs\py38\lib\site-packages (from matplotlib->mmdet==2.22.0) (0.11.0)
Requirement already satisfied: python-dateutil>=2.7 in c:\users\administrator\miniconda3\envs\py38\lib\site-packages (from matplotlib->mmdet==2.22.0) (2.8.2)
Requirement already satisfied: pillow>=6.2.0 in c:\users\administrator\miniconda3\envs\py38\lib\site-packages (from matplotlib->mmdet==2.22.0) (9.0.1)
Building wheels for collected packages: pycocotools
  Building wheel for pycocotools (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\Administrator\miniconda3\envs\py38\python.exe' 'C:\Users\Administrator\miniconda3\envs\py38\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\ADMINI~1\AppData\Local\Temp\tmprgehj4jg'
       cwd: C:\Users\Administrator\AppData\Local\Temp\pip-install-skr_hg80\pycocotools_9e584a053ba44d929b7530e67949486d
  Complete output (14 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.8
  creating build\lib.win-amd64-3.8\pycocotools
  copying pycocotools\coco.py -> build\lib.win-amd64-3.8\pycocotools
  copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.8\pycocotools
  copying pycocotools\mask.py -> build\lib.win-amd64-3.8\pycocotools
  copying pycocotools\__init__.py -> build\lib.win-amd64-3.8\pycocotools
  running build_ext
  skipping 'pycocotools\_mask.c' Cython extension (up-to-date)
  building 'pycocotools._mask' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  ----------------------------------------
  ERROR: Failed building wheel for pycocotools
Failed to build pycocotools
ERROR: Could not build wheels for pycocotools which use PEP 517 and cannot be installed directly

Bug fix If you have already identified the reason, you can provide the information here. If you are willing to create a PR to fix it, please also leave a comment here and that would be much appreciated! The problem should be like this, change this line in file requirement/runtime.txt to

pycocotools; platform_system == "Linux"
pycocotools-windows; platform_system == "Windows"

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
EasonQYScommented, Mar 12, 2022

#7374 I have make this to PR.

1reaction
EasonQYScommented, Mar 11, 2022

Yes, using Windows and python3.8.12, if use python3.9, it won’t work because we don’t have a whl for py39

Read more comments on GitHub >

github_iconTop Results From Across the Web

can`t install pycocotools | The AI Search Engine You Control
But I try mmdet==2.19.1, which accept pycocotools-windows and it can be easy installed with py38. So I think it is easy to fix,...
Read more >
Installation — MMDetection 2.2.1 documentation
A from-scratch setup script​​ txt pip install "git+https://github.com/open-mmlab/cocoapi.git#subdirectory=pycocotools" pip install -v -e .
Read more >
pip3 install mmdet giving an error failed to build pycocotools
When installing OpenMMDetection toolbox, I try to install mmdet package but it gives the following erro. I installed VSC++ 14.20 and ...
Read more >
mmdet - PyPI
mmdet 2.26.0 · Introduction. MMDetection is an open source object detection toolbox based on PyTorch. · What's New. Stable version · Installation. Please...
Read more >
mmdetection - bytemeta
mmdet >=2.20.0 windows py38 can't install beacause of pycocotools. dr-GitHub-account. dr-GitHub-account CLOSED · Updated 6 months ago ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found