Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YOLOX is not installing #1585

Open
azimjonn opened this issue Jan 2, 2023 · 14 comments
Open

YOLOX is not installing #1585

azimjonn opened this issue Jan 2, 2023 · 14 comments

Comments

@azimjonn
Copy link

azimjonn commented Jan 2, 2023

To install yolox I did these two:

git clone git@github.com:Megvii-BaseDetection/YOLOX.git
cd YOLOX

Then pip3 install -v -e . is not working. Here is the log of this command.

Using pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)
Defaulting to user installation because normal site-packages is not writeable
Obtaining file:///mnt/Shared/azimjon/YOLOX
  Running command python setup.py egg_info
  running egg_info
  creating /tmp/pip-pip-egg-info-ypvf739l/yolox.egg-info
  writing /tmp/pip-pip-egg-info-ypvf739l/yolox.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-pip-egg-info-ypvf739l/yolox.egg-info/dependency_links.txt
  writing requirements to /tmp/pip-pip-egg-info-ypvf739l/yolox.egg-info/requires.txt
  writing top-level names to /tmp/pip-pip-egg-info-ypvf739l/yolox.egg-info/top_level.txt
  writing manifest file '/tmp/pip-pip-egg-info-ypvf739l/yolox.egg-info/SOURCES.txt'
  /home/azimjon/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py:476: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
    warnings.warn(msg.format('we could not find ninja.'))
  reading manifest file '/tmp/pip-pip-egg-info-ypvf739l/yolox.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no files found matching '*.cu' under directory 'yolox'
  warning: no files found matching '*.cuh' under directory 'yolox'
  warning: no files found matching '*.cc' under directory 'yolox'
  adding license file 'LICENSE'
  writing manifest file '/tmp/pip-pip-egg-info-ypvf739l/yolox.egg-info/SOURCES.txt'
  Preparing metadata (setup.py) ... done
Collecting loguru
  Using cached loguru-0.6.0-py3-none-any.whl (58 kB)
Collecting ninja
  Using cached ninja-1.11.1-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (145 kB)
Collecting numpy
  Using cached numpy-1.24.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
Collecting onnx-simplifier==0.4.1
  Using cached onnx-simplifier-0.4.1.tar.gz (19.8 MB)
  Running command python setup.py egg_info
  fatal: not a git repository (or any of the parent directories): .git
  fatal: not a git repository (or any of the parent directories): .git
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-install-q2xkxl0n/onnx-simplifier_795fe5484b37426fb7feb48837b76bd9/setup.py", line 64, in <module>
      assert CMAKE, 'Could not find "cmake" executable!'
  AssertionError: Could not find "cmake" executable!
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /usr/bin/python3 -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  # - It provides a clear error message when setuptools is not installed.
  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
  #     manifest_maker: standard file '"'"'-c'"'"' not found".
  # - It generates a shim setup.py, for handling setup.cfg-only projects.
  import os, sys, tokenize
  
  try:
      import setuptools
  except ImportError as error:
      print(
          "ERROR: Can not execute `setup.py` since setuptools is not available in "
          "the build environment.",
          file=sys.stderr,
      )
      sys.exit(1)
  
  __file__ = %r
  sys.argv[0] = __file__
  
  if os.path.exists(__file__):
      filename = __file__
      with tokenize.open(__file__) as f:
          setup_py_code = f.read()
  else:
      filename = "<auto-generated setuptools caller>"
      setup_py_code = "from setuptools import setup; setup()"
  
  exec(compile(setup_py_code, filename, "exec"))
  '"'"''"'"''"'"' % ('"'"'/tmp/pip-install-q2xkxl0n/onnx-simplifier_795fe5484b37426fb7feb48837b76bd9/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' egg_info --egg-base /tmp/pip-pip-egg-info-nazgrqy3
  cwd: /tmp/pip-install-q2xkxl0n/onnx-simplifier_795fe5484b37426fb7feb48837b76bd9/
  Preparing metadata (setup.py) ... error
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.

@azimjonn
Copy link
Author

azimjonn commented Jan 2, 2023

pip install yolox is also not working:
` pip install yolox
Defaulting to user installation because normal site-packages is not writeable
Collecting yolox
Downloading yolox-0.3.0.tar.gz (79 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 80.0/80.0 KB 306.8 kB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Requirement already satisfied: Pillow in /usr/lib/python3/dist-packages (from yolox) (9.0.1)
Collecting loguru
Using cached loguru-0.6.0-py3-none-any.whl (58 kB)
Collecting ninja
Using cached ninja-1.11.1-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (145 kB)
Collecting numpy
Using cached numpy-1.24.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
Collecting onnx-simplifier==0.3.5
Downloading onnx-simplifier-0.3.5.tar.gz (13 kB)
Preparing metadata (setup.py) ... done
Collecting onnx==1.8.1
Using cached onnx-1.8.1.tar.gz (5.2 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [19 lines of output]
fatal: not a git repository (or any of the parent directories): .git
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in
main()
File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
return hook(config_settings)
File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 162, in get_requires_for_build_wheel
return self._get_build_requires(
File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 143, in _get_build_requires
self.run_setup()
File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 267, in run_setup
super(_BuildMetaLegacyBackend,
File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 158, in run_setup
exec(compile(code, file, 'exec'), locals())
File "setup.py", line 75, in
assert CMAKE, 'Could not find "cmake" executable!'
AssertionError: Could not find "cmake" executable!
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.`

@FateScript
Copy link
Member

What if you execute pip install onnx in your cli ?

@azimjonn
Copy link
Author

azimjonn commented Jan 3, 2023

It is installing successfully.

@azimjonn
Copy link
Author

azimjonn commented Jan 3, 2023

@FateScript

So, finally it worked with python3.8. Above error occured with python3.10.
Can you add python version to installation section? So people don't get such errors then.

@FateScript
Copy link
Member

@azimjonn Thanks for your advice! I will check py3.10 and see what's behind the installing error.

@VanIseghemThomas
Copy link

Python 3.10 has a lot of issues installing. The requirements.txt file also has some problems. Here is mine:

numpy
opencv_python
loguru
tqdm
torchvision
thop
ninja
tabulate
psutil
onnxruntime
onnx-simplifier
tensorboard
pycocotools
onnx

@fedyhajali
Copy link

fedyhajali commented Feb 21, 2023

@FateScript Is there any news on this ? so I cannot currently use pip install yolox with Python 3.10 ?

I launch it and I get this error:

Collecting yolox
  Using cached yolox-0.2.0.tar.gz (65 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
      No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda-10.2'
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-f8otgzny/yolox_30db8243af20470d9aeb286bc0b9c223/setup.py", line 77, in <module>
          install_requires=get_install_requirements(),
        File "/tmp/pip-install-f8otgzny/yolox_30db8243af20470d9aeb286bc0b9c223/setup.py", line 49, in get_install_requirements
          with open("requirements.txt", "r", encoding="utf-8") as f:
      FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

@FateScript
Copy link
Member

@fedyhajali You are using a old version whl, try clone YOLOX and install it with pip install -v -e ., after we releasing a new package, you may install yolox through pip install yolox.

BTW, If you are using python under 3.10, pip intall yolox==0.3.0 might help you.

@aus10powell
Copy link

aus10powell commented Jun 18, 2023

So I have the same problem as all above. Here are the issues and versions I tried until was success in install:

  • Tried on python 3.9 all pip installs: pip3 install -v -e ., pip install yolox
  • Worked when I switched to python 3.8 pip3 install -v -e . (pip install yolox did not work)

@duane-edgington
Copy link

On Mac OS 13.4.1(c) Apple M1 Max. python 3.11
pip install --no-cache "yolox==0.3.0" fails
pip install yolox==0.3.0 fails
pip install yolox fails. Using cached yolox-0.2.0.tar.gz (65 kB) ...FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'

pip install onnx works fine

git clone https://github.com/Megvii-BaseDetection/YOLOX.git
pip install --upgrade pip setuptools
pip3 install -v -e .
fails

try:
import setuptools
except ImportError as error:
print(
"ERROR: Can not execute setup.py since setuptools is not available in "
"the build environment.",
file=sys.stderr,
)
sys.exit(1)

file = %r
sys.argv[0] = file

if os.path.exists(file):
filename = file
with tokenize.open(file) as f:
setup_py_code = f.read()
else:
filename = ""
setup_py_code = "from setuptools import setup; setup()"

exec(compile(setup_py_code, filename, "exec"))
'"'"''"'"''"'"' % ('"'"'/private/var/folders/2v/b7nh79c55fvbjw_k_p7s1rnw000096/T/pip-install-wib6clg7/onnx-simplifier_f8f536eea74d46fb9bd8c2591a57cac6/setup.py'"'"',), "", "exec"))' egg_info --egg-base /private/var/folders/2v/b7nh79c55fvbjw_k_p7s1rnw000096/T/pip-pip-egg-info-yvtw047b
cwd: /private/var/folders/2v/b7nh79c55fvbjw_k_p7s1rnw000096/T/pip-install-wib6clg7/onnx-simplifier_f8f536eea74d46fb9bd8c2591a57cac6/
Preparing metadata (setup.py) ... error
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.

Can you advise? I will try downgrading python if you think that is the issue. thank you.

@aus10powell
Copy link

aus10powell commented Jul 14, 2023 via email

@duane-edgington
Copy link

yolox install failure.txt
I tried again, this time having downgraded python to Python 3.8.17 within my virtual environment.

Still fails after

pip3 install -v -e .

yolox install failure.txt

@fedyhajali
Copy link

@duane-edgington Install torch in you env before running the command 'pip3 install -v -e . ".

@siddagra
Copy link

python3.8 is also not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants