0

I am trying to create a project using python, detectron2, opencv and tkinter. I created a virtual environment with anaconda and created part of my code with opencv, tkinter and python successefully. But I am having trouble installing detectron2 on my windows. I followed the instructions on https://haroonshakeel.medium.com/detectron2-setup-on-windows-10-and-linux-407e5382df1, but I am having a trouble running this part "pip install -e ."

Obtaining file:///C:/Users/Lenovo/detectron2
Requirement already satisfied: Pillow>=7.1 in c:\users\lenovo\anaconda3\envs\detectron_env\lib\site-packages (from detectron2==0.6) (9.0.1)
Collecting matplotlib
  Using cached matplotlib-3.5.1-cp38-cp38-win_amd64.whl (7.2 MB)
Collecting pycocotools>=2.0.2
  Using cached pycocotools-2.0.4.tar.gz (106 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting termcolor>=1.1
  Using cached termcolor-1.1.0-py3-none-any.whl
Collecting yacs>=0.1.8
  Using cached yacs-0.1.8-py3-none-any.whl (14 kB)
Collecting tabulate
  Using cached tabulate-0.8.9-py3-none-any.whl (25 kB)
Collecting cloudpickle
  Using cached cloudpickle-2.0.0-py3-none-any.whl (25 kB)
Collecting tqdm>4.29.0
  Using cached tqdm-4.63.1-py2.py3-none-any.whl (76 kB)
Collecting tensorboard
  Using cached tensorboard-2.8.0-py3-none-any.whl (5.8 MB)
Collecting fvcore<0.1.6,>=0.1.5
  Using cached fvcore-0.1.5.post20220305-py3-none-any.whl
Collecting iopath<0.1.10,>=0.1.7
  Using cached iopath-0.1.9-py3-none-any.whl (27 kB)
Collecting future
  Using cached future-0.18.2-py3-none-any.whl
Collecting pydot
  Using cached pydot-1.4.2-py2.py3-none-any.whl (21 kB)
Collecting omegaconf>=2.1
  Using cached omegaconf-2.1.1-py3-none-any.whl (74 kB)
Collecting hydra-core>=1.1
  Using cached hydra_core-1.1.1-py3-none-any.whl (145 kB)
Collecting black==21.4b2
  Using cached black-21.4b2-py3-none-any.whl (130 kB)
Collecting scipy>1.5.1
  Using cached scipy-1.8.0-cp38-cp38-win_amd64.whl (36.9 MB)
Collecting pathspec<1,>=0.8.1
  Using cached pathspec-0.9.0-py2.py3-none-any.whl (31 kB)
Collecting regex>=2020.1.8
  Using cached regex-2022.3.15-cp38-cp38-win_amd64.whl (274 kB)
Collecting toml>=0.10.1
  Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting mypy-extensions>=0.4.3
  Using cached mypy_extensions-0.4.3-py2.py3-none-any.whl (4.5 kB)
Collecting click>=7.1.2
  Using cached click-8.1.2-py3-none-any.whl (96 kB)
Collecting appdirs
  Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting colorama
  Using cached colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting pyyaml>=5.1
  Using cached PyYAML-6.0-cp38-cp38-win_amd64.whl (155 kB)
Requirement already satisfied: numpy in c:\users\lenovo\anaconda3\envs\detectron_env\lib\site-packages (from fvcore<0.1.6,>=0.1.5->detectron2==0.6) (1.21.5)
Collecting antlr4-python3-runtime==4.8
  Using cached antlr4_python3_runtime-4.8-py3-none-any.whl
Collecting importlib-resources
  Using cached importlib_resources-5.6.0-py3-none-any.whl (28 kB)
Collecting portalocker
  Using cached portalocker-2.4.0-py2.py3-none-any.whl (16 kB)
Collecting packaging>=20.0
  Using cached packaging-21.3-py3-none-any.whl (40 kB)
Collecting pyparsing>=2.2.1
  Using cached pyparsing-3.0.7-py3-none-any.whl (98 kB)
Collecting python-dateutil>=2.7
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting fonttools>=4.22.0
  Using cached fonttools-4.31.2-py3-none-any.whl (899 kB)
Collecting cycler>=0.10
  Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting kiwisolver>=1.0.1
  Using cached kiwisolver-1.4.2-cp38-cp38-win_amd64.whl (55 kB)
Requirement already satisfied: six>=1.5 in c:\users\lenovo\anaconda3\envs\detectron_env\lib\site-packages (from python-dateutil>=2.7->matplotlib->detectron2==0.6) (1.16.0)
Collecting zipp>=3.1.0
  Using cached zipp-3.7.0-py3-none-any.whl (5.3 kB)
Collecting pywin32>=226
  Using cached pywin32-303-cp38-cp38-win_amd64.whl (9.3 MB)
Requirement already satisfied: setuptools>=41.0.0 in c:\users\lenovo\anaconda3\envs\detectron_env\lib\site-packages (from tensorboard->detectron2==0.6) (58.0.4)
Collecting tensorboard-plugin-wit>=1.6.0
  Using cached tensorboard_plugin_wit-1.8.1-py3-none-any.whl (781 kB)
Collecting markdown>=2.6.8
  Using cached Markdown-3.3.6-py3-none-any.whl (97 kB)
Collecting absl-py>=0.4
  Using cached absl_py-1.0.0-py3-none-any.whl (126 kB)
Collecting tensorboard-data-server<0.7.0,>=0.6.0
  Using cached tensorboard_data_server-0.6.1-py3-none-any.whl (2.4 kB)
Collecting werkzeug>=0.11.15
  Using cached Werkzeug-2.1.0-py3-none-any.whl (224 kB)
Collecting protobuf>=3.6.0
  Using cached protobuf-3.19.4-cp38-cp38-win_amd64.whl (895 kB)
Collecting grpcio>=1.24.3
  Using cached grpcio-1.44.0-cp38-cp38-win_amd64.whl (3.4 MB)
Collecting google-auth<3,>=1.6.3
  Using cached google_auth-2.6.2-py2.py3-none-any.whl (156 kB)
Collecting google-auth-oauthlib<0.5,>=0.4.1
  Using cached google_auth_oauthlib-0.4.6-py2.py3-none-any.whl (18 kB)
Requirement already satisfied: wheel>=0.26 in c:\users\lenovo\anaconda3\envs\detectron_env\lib\site-packages (from tensorboard->detectron2==0.6) (0.37.1)
Requirement already satisfied: requests<3,>=2.21.0 in c:\users\lenovo\anaconda3\envs\detectron_env\lib\site-packages (from tensorboard->detectron2==0.6) (2.27.1)
Collecting pyasn1-modules>=0.2.1
  Using cached pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
Collecting cachetools<6.0,>=2.0.0
  Using cached cachetools-5.0.0-py3-none-any.whl (9.1 kB)
Collecting rsa<5,>=3.1.4
  Using cached rsa-4.8-py3-none-any.whl (39 kB)
Collecting requests-oauthlib>=0.7.0
  Using cached requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB)
Collecting importlib-metadata>=4.4
  Using cached importlib_metadata-4.11.3-py3-none-any.whl (18 kB)
Collecting pyasn1<0.5.0,>=0.4.6
  Using cached pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\lenovo\anaconda3\envs\detectron_env\lib\site-packages (from requests<3,>=2.21.0->tensorboard->detectron2==0.6) (1.26.8)
Requirement already satisfied: idna<4,>=2.5 in c:\users\lenovo\anaconda3\envs\detectron_env\lib\site-packages (from requests<3,>=2.21.0->tensorboard->detectron2==0.6) (3.3)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\lenovo\anaconda3\envs\detectron_env\lib\site-packages (from requests<3,>=2.21.0->tensorboard->detectron2==0.6) (2021.10.8)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\lenovo\anaconda3\envs\detectron_env\lib\site-packages (from requests<3,>=2.21.0->tensorboard->detectron2==0.6) (2.0.4)
Collecting oauthlib>=3.0.0
  Using cached oauthlib-3.2.0-py3-none-any.whl (151 kB)
Building wheels for collected packages: pycocotools
  Building wheel for pycocotools (PEP 517) ... error
  **ERROR: Command errored out with exit status 1:
   command: 'C:\Users\Lenovo\anaconda3\envs\detectron_env\python.exe' 'C:\Users\Lenovo\anaconda3\envs\detectron_env\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\Lenovo\AppData\Local\Temp\tmpm3cvme_m'
       cwd: C:\Users\Lenovo\AppData\Local\Temp\pip-install-ikpywiuc\pycocotools_80bd6ca18d19476f9a573833cfa6d598
  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**

This is how it looks like as an image.

enter image description here

Any help would be appreciated. I can do 1 on 1 sessions for to get help more accurately.

1 Answers1

1

I found my solution. I had to install Microsoft Visual C++ 14.

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 01 '22 at 15:57