Trying to install Tensorflow 2, but when i write “python -m pip install .” in anaconda prompt I get an error. I tried different methods to resolve this problem, but nothing… Such of these methods: trying to install on python 3.11 and 3.12, updating and downgrading pip, updating setuptools, setting Cython constrain file and downgrading cython versions… So, i hope, someone know how to resolve this trouble. Very appreciate your answers.
Code of error:
Processing c:\games\tenserflow\models\research
Preparing metadata (setup.py) ... done
Collecting avro-python3 (from object-detection==0.1)
Using cached avro-python3-1.10.2.tar.gz (38 kB)
Preparing metadata (setup.py) ... done
Collecting apache-beam (from object-detection==0.1)
Using cached apache_beam-2.53.0-cp311-cp311-win_amd64.whl.metadata (6.7 kB)
Collecting pillow (from object-detection==0.1)
Using cached pillow-10.2.0-cp311-cp311-win_amd64.whl.metadata (9.9 kB)
Collecting lxml (from object-detection==0.1)
Using cached lxml-5.1.0-cp311-cp311-win_amd64.whl.metadata (3.6 kB)
Collecting matplotlib (from object-detection==0.1)
Using cached matplotlib-3.8.2-cp311-cp311-win_amd64.whl.metadata (5.9 kB)
Requirement already satisfied: Cython in c:\users\ihor_\anaconda3\envs\tf2\lib\site-packages (from object-detection==0.1) (3.0.8)
Collecting contextlib2 (from object-detection==0.1)
Using cached contextlib2-21.6.0-py2.py3-none-any.whl (13 kB)
Collecting tf-slim (from object-detection==0.1)
Using cached tf_slim-1.1.0-py2.py3-none-any.whl (352 kB)
Collecting six (from object-detection==0.1)
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Requirement already satisfied: pycocotools in c:\users\ihor_\anaconda3\envs\tf2\lib\site-packages (from object-detection==0.1) (2.0)
Collecting lvis (from object-detection==0.1)
Using cached lvis-0.5.3-py3-none-any.whl (14 kB)
Collecting scipy (from object-detection==0.1)
Using cached scipy-1.11.4-cp311-cp311-win_amd64.whl.metadata (60 kB)
Collecting pandas (from object-detection==0.1)
Using cached pandas-2.1.4-cp311-cp311-win_amd64.whl.metadata (18 kB)
Collecting tf-models-official>=2.5.1 (from object-detection==0.1)
Using cached tf_models_official-2.15.0-py2.py3-none-any.whl.metadata (1.4 kB)
Collecting tensorflow_io (from object-detection==0.1)
Using cached tensorflow_io-0.31.0-cp311-cp311-win_amd64.whl (22.9 MB)
Collecting keras (from object-detection==0.1)
Using cached keras-3.0.2-py3-none-any.whl.metadata (4.8 kB)
Collecting pyparsing==2.4.7 (from object-detection==0.1)
Using cached pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
Collecting sacrebleu<=2.2.0 (from object-detection==0.1)
Using cached sacrebleu-2.2.0-py3-none-any.whl (116 kB)
Collecting portalocker (from sacrebleu<=2.2.0->object-detection==0.1)
Using cached portalocker-2.8.2-py3-none-any.whl.metadata (8.5 kB)
Collecting regex (from sacrebleu<=2.2.0->object-detection==0.1)
Using cached regex-2023.12.25-cp311-cp311-win_amd64.whl.metadata (41 kB)
Collecting tabulate>=0.8.9 (from sacrebleu<=2.2.0->object-detection==0.1)
Using cached tabulate-0.9.0-py3-none-any.whl (35 kB)
Requirement already satisfied: numpy>=1.17 in c:\users\ihor_\anaconda3\envs\tf2\lib\site-packages (from sacrebleu<=2.2.0->object-detection==0.1) (1.26.3)
Requirement already satisfied: colorama in c:\users\ihor_\anaconda3\envs\tf2\lib\site-packages (from sacrebleu<=2.2.0->object-detection==0.1) (0.4.6)
Collecting gin-config (from tf-models-official>=2.5.1->object-detection==0.1)
Using cached gin_config-0.5.0-py3-none-any.whl (61 kB)
Collecting google-api-python-client>=1.6.7 (from tf-models-official>=2.5.1->object-detection==0.1)
Using cached google_api_python_client-2.113.0-py2.py3-none-any.whl.metadata (6.6 kB)
Collecting immutabledict (from tf-models-official>=2.5.1->object-detection==0.1)
Using cached immutabledict-4.1.0-py3-none-any.whl.metadata (3.2 kB)
Collecting kaggle>=1.3.9 (from tf-models-official>=2.5.1->object-detection==0.1)
Using cached kaggle-1.6.3.tar.gz (84 kB)
Preparing metadata (setup.py) ... done
Collecting oauth2client (from tf-models-official>=2.5.1->object-detection==0.1)
Using cached oauth2client-4.1.3-py2.py3-none-any.whl (98 kB)
Collecting opencv-python-headless (from tf-models-official>=2.5.1->object-detection==0.1)
Using cached opencv_python_headless-4.9.0.80-cp37-abi3-win_amd64.whl.metadata (20 kB)
Collecting psutil>=5.4.3 (from tf-models-official>=2.5.1->object-detection==0.1)
Using cached psutil-5.9.7-cp37-abi3-win_amd64.whl.metadata (22 kB)
Collecting py-cpuinfo>=3.3.0 (from tf-models-official>=2.5.1->object-detection==0.1)
Using cached py_cpuinfo-9.0.0-py3-none-any.whl (22 kB)
Collecting pyyaml>=6.0.0 (from tf-models-official>=2.5.1->object-detection==0.1)
Using cached PyYAML-6.0.1-cp311-cp311-win_amd64.whl.metadata (2.1 kB)
Collecting sentencepiece (from tf-models-official>=2.5.1->object-detection==0.1)
Using cached sentencepiece-0.1.99-cp311-cp311-win_amd64.whl (977 kB)
Collecting seqeval (from tf-models-official>=2.5.1->object-detection==0.1)
Using cached seqeval-1.2.2.tar.gz (43 kB)
Preparing metadata (setup.py) ... done
Collecting tensorflow-datasets (from tf-models-official>=2.5.1->object-detection==0.1)
Using cached tensorflow_datasets-4.9.4-py3-none-any.whl.metadata (9.2 kB)
Collecting tensorflow-hub>=0.6.0 (from tf-models-official>=2.5.1->object-detection==0.1)
Using cached tensorflow_hub-0.15.0-py2.py3-none-any.whl.metadata (1.3 kB)
Collecting tensorflow-model-optimization>=0.4.1 (from tf-models-official>=2.5.1->object-detection==0.1)
Using cached tensorflow_model_optimization-0.7.5-py2.py3-none-any.whl.metadata (914 bytes)
INFO: pip is looking at multiple versions of tf-models-official to determine which version is compatible with other requirements. This could take a while.
Collecting tf-models-official>=2.5.1 (from object-detection==0.1)
Using cached tf_models_official-2.14.2-py2.py3-none-any.whl.metadata (1.4 kB)
Using cached tf_models_official-2.14.1-py2.py3-none-any.whl.metadata (1.4 kB)
Using cached tf_models_official-2.14.0-py2.py3-none-any.whl.metadata (1.4 kB)
Using cached tf_models_official-2.13.2-py2.py3-none-any.whl.metadata (1.4 kB)
Using cached tf_models_official-2.13.1-py2.py3-none-any.whl.metadata (1.4 kB)
Collecting pyyaml<5.4.0,>=5.1 (from tf-models-official>=2.5.1->object-detection==0.1)
Using cached PyYAML-5.3.1.tar.gz (269 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [51 lines of output]
C:\Users\ihor_\anaconda3\envs\tf2\Lib\site-packages\setuptools\config\setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg`
!!
********************************************************************************
The license_file parameter is deprecated, use license_files instead.
This deprecation is overdue, please update your project and remove deprecated
calls to avoid build errors in the future.
See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
********************************************************************************
!!
parsed = self.parsers.get(option_name, lambda x: x)(value)
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\ihor_\AppData\Local\Temp\pip-install-hjp9n2rr\pyyaml_81e9f1c73d0243d993d666633bec91be\setup.py", line 291, in <module>
setup(
File "C:\Users\ihor_\anaconda3\envs\tf2\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
^^^^^^^^^^^^^^^^^^
File "C:\Users\ihor_\anaconda3\envs\tf2\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\ihor_\anaconda3\envs\tf2\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\ihor_\anaconda3\envs\tf2\Lib\site-packages\setuptools\dist.py", line 989, in run_command
super().run_command(command)
File "C:\Users\ihor_\anaconda3\envs\tf2\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\ihor_\anaconda3\envs\tf2\Lib\site-packages\setuptools\command\egg_info.py", line 318, in run
self.find_sources()
File "C:\Users\ihor_\anaconda3\envs\tf2\Lib\site-packages\setuptools\command\egg_info.py", line 326, in find_sources
mm.run()
File "C:\Users\ihor_\anaconda3\envs\tf2\Lib\site-packages\setuptools\command\egg_info.py", line 548, in run
self.add_defaults()
File "C:\Users\ihor_\anaconda3\envs\tf2\Lib\site-packages\setuptools\command\egg_info.py", line 586, in add_defaults
sdist.add_defaults(self)
File "C:\Users\ihor_\anaconda3\envs\tf2\Lib\site-packages\setuptools\command\sdist.py", line 113, in add_defaults
super().add_defaults()
File "C:\Users\ihor_\anaconda3\envs\tf2\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 251, in add_defaults
self._add_defaults_ext()
File "C:\Users\ihor_\anaconda3\envs\tf2\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 336, in _add_defaults_ext
self.filelist.extend(build_ext.get_source_files())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ihor_\AppData\Local\Temp\pip-install-hjp9n2rr\pyyaml_81e9f1c73d0243d993d666633bec91be\setup.py", line 199, in get_source_files
self.cython_sources(ext.sources, ext)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\ihor_\anaconda3\envs\tf2\Lib\site-packages\setuptools\_distutils\cmd.py", line 107, in __getattr__
raise AttributeError(attr)
AttributeError: cython_sources
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.