Closed weertman closed 5 months ago
@weertman hi, thanks for the bug report! If lap is not automatically installing correctly, then you can install it like this:
pip install -U lap
Hey Glenn,
I found that I had to install visual studio tools C++ and then it installed.
-Willem
On Sun, Apr 2, 2023 at 17:21 Glenn Jocher @.***> wrote:
@weertman https://github.com/weertman hi, thanks for the bug report! If lap is not automatically installing correctly, then you can install it like this:
pip install -U lap
β Reply to this email directly, view it on GitHub https://github.com/ultralytics/ultralytics/issues/1775#issuecomment-1493483825, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUT4RD53SE5SPOBCA7WGTC3W7IJYFANCNFSM6AAAAAAWQS5JRU . You are receiving this because you were mentioned.Message ID: @.***>
I use pip install -U lap but it still error
seeing a similar error but I'm not sure if it's related?
pip install -U lap
didn't help.
C++ build tools are installed on my machine too. @weertman which version of the build tools did you install?
Windows 10, Python 3.9.4, pip 23.0.1, setuptools 67.6.1
pip install -r requirements.txt # install dependencies
and pip install -U lap
both fail with this error:
error: subprocess-exited-with-error
Γ Running setup.py install for lap did not run successfully.
β exit code: 1
β°β> [138 lines of output]
Partial import of lap during the build process.
Generating cython files
running install
c:\python39\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running config_cc
INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
INFO: build_src
INFO: building extension "lap._lapjv" sources
INFO: building data_files sources
INFO: build_src: building npy-pkg config files
running build_py
creating build
creating build\lib.win-amd64-cpython-39
creating build\lib.win-amd64-cpython-39\lap
copying lap\lapmod.py -> build\lib.win-amd64-cpython-39\lap
copying lap\__init__.py -> build\lib.win-amd64-cpython-39\lap
running build_ext
INFO: No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
INFO: customize MSVCCompiler
INFO: customize MSVCCompiler using build_ext
INFO: CCompilerOpt.cc_test_flags[1021] : testing flags (/O2)
creating C:\Users\xxx\AppData\Local\Temp\tmp8m9t7wuc\Python39
creating C:\Users\xxx\AppData\Local\Temp\tmp8m9t7wuc\Python39\Lib
creating C:\Users\xxx\AppData\Local\Temp\tmp8m9t7wuc\Python39\Lib\site-packages
creating C:\Users\xxx\AppData\Local\Temp\tmp8m9t7wuc\Python39\Lib\site-packages\numpy
creating C:\Users\xxx\AppData\Local\Temp\tmp8m9t7wuc\Python39\Lib\site-packages\numpy\distutils
creating C:\Users\xxx\AppData\Local\Temp\tmp8m9t7wuc\Python39\Lib\site-packages\numpy\distutils\checks
INFO: CCompilerOpt.cc_test_flags[1021] : testing flags (/WX)
WARN: CCompilerOpt.__init__[1167] : feature 'AVX512_KNL' is disabled, MSVC compiler doesn't support it
WARN: CCompilerOpt.__init__[1167] : feature 'AVX512_KNM' is disabled, MSVC compiler doesn't support it
INFO: CCompilerOpt.__init__[1709] : check requested baseline
INFO: CCompilerOpt.feature_test[1474] : testing feature 'SSE' with flags ()
INFO: CCompilerOpt.feature_test[1474] : testing feature 'SSE2' with flags ()
INFO: CCompilerOpt.feature_test[1474] : testing feature 'SSE3' with flags ()
INFO: CCompilerOpt.__init__[1718] : check requested dispatch-able features
INFO: CCompilerOpt.feature_test[1474] : testing feature 'SSE42' with flags ()
INFO: CCompilerOpt.cc_test_flags[1021] : testing flags (/arch:AVX)
INFO: CCompilerOpt.cc_test_flags[1021] : testing flags (/arch:AVX2)
INFO: CCompilerOpt.feature_test[1474] : testing feature 'AVX2' with flags (/arch:AVX2)
INFO: CCompilerOpt.cc_test_flags[1021] : testing flags (/arch:AVX512)
INFO: CCompilerOpt.feature_test[1474] : testing feature 'AVX512_SKX' with flags (/arch:AVX512)
INFO: CCompilerOpt.feature_test[1474] : testing feature 'SSSE3' with flags ()
INFO: CCompilerOpt.feature_test[1474] : testing feature 'AVX' with flags (/arch:AVX)
INFO: CCompilerOpt.feature_test[1474] : testing feature 'POPCNT' with flags ()
INFO: CCompilerOpt.feature_test[1474] : testing feature 'SSE41' with flags ()
INFO: CCompilerOpt.feature_test[1474] : testing feature 'F16C' with flags (/arch:AVX)
INFO: CCompilerOpt.feature_test[1474] : testing feature 'AVX512F' with flags (/arch:AVX512)
INFO: CCompilerOpt.feature_test[1474] : testing feature 'FMA3' with flags (/arch:AVX2)
INFO: CCompilerOpt.feature_test[1474] : testing feature 'AVX512CD' with flags (/arch:AVX512)
INFO: CCompilerOpt.feature_test[1474] : testing feature 'AVX512_CLX' with flags (/arch:AVX512)
INFO: CCompilerOpt.feature_test[1474] : testing feature 'AVX512_CNL' with flags (/arch:AVX512)
INFO: CCompilerOpt.feature_test[1474] : testing feature 'AVX512_ICL' with flags (/arch:AVX512)
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\xxx\AppData\Local\Temp\pip-install-o1wtikmt\lap_e8181bdbc8cc4fb2b69b52c119ed97e6\setup.py", line 236, in <module>
setup_package()
File "C:\Users\xxx\AppData\Local\Temp\pip-install-o1wtikmt\lap_e8181bdbc8cc4fb2b69b52c119ed97e6\setup.py", line 232, in setup_package
setup(**metadata)
File "c:\python39\lib\site-packages\numpy\distutils\core.py", line 169, in setup
return old_setup(**new_attr)
File "c:\python39\lib\site-packages\setuptools\__init__.py", line 108, in setup
return distutils.core.setup(**attrs)
File "c:\python39\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "c:\python39\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "c:\python39\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "c:\python39\lib\site-packages\setuptools\dist.py", line 1221, in run_command
super().run_command(command)
File "c:\python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "c:\python39\lib\site-packages\numpy\distutils\command\install.py", line 60, in run
r = self.setuptools_run()
File "c:\python39\lib\site-packages\numpy\distutils\command\install.py", line 34, in setuptools_run
return distutils_install.run(self)
File "c:\python39\lib\site-packages\setuptools\_distutils\command\install.py", line 697, in run
self.run_command('build')
File "c:\python39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "c:\python39\lib\site-packages\setuptools\dist.py", line 1221, in run_command
super().run_command(command)
File "c:\python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "c:\python39\lib\site-packages\numpy\distutils\command\build.py", line 61, in run
old_build.run(self)
File "c:\python39\lib\site-packages\setuptools\_distutils\command\build.py", line 131, in run
self.run_command(cmd_name)
File "c:\python39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "c:\python39\lib\site-packages\setuptools\dist.py", line 1221, in run_command
super().run_command(command)
File "c:\python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "c:\python39\lib\site-packages\numpy\distutils\command\build_ext.py", line 163, in run
self.compiler_opt = new_ccompiler_opt(
File "c:\python39\lib\site-packages\numpy\distutils\ccompiler_opt.py", line 2577, in new_ccompiler_opt
opt = CCompilerOpt(compiler, **kwargs)
File "c:\python39\lib\site-packages\numpy\distutils\ccompiler_opt.py", line 2145, in __init__
_Parse.__init__(self, cpu_baseline, cpu_dispatch)
File "c:\python39\lib\site-packages\numpy\distutils\ccompiler_opt.py", line 1727, in __init__
self.feature_names(cpu_dispatch)
File "c:\python39\lib\site-packages\numpy\distutils\ccompiler_opt.py", line 1217, in feature_names
if self.feature_is_supported(
File "c:\python39\lib\site-packages\numpy\distutils\ccompiler_opt.py", line 861, in cache_wrap_me
ccb = cb(self, *args, **kwargs)
File "c:\python39\lib\site-packages\numpy\distutils\ccompiler_opt.py", line 1518, in feature_is_supported
if not self.feature_test(name, force_flags, macros=macros):
File "c:\python39\lib\site-packages\numpy\distutils\ccompiler_opt.py", line 861, in cache_wrap_me
ccb = cb(self, *args, **kwargs)
File "c:\python39\lib\site-packages\numpy\distutils\ccompiler_opt.py", line 1486, in feature_test
test = self.dist_test(
File "c:\python39\lib\site-packages\numpy\distutils\ccompiler_opt.py", line 585, in dist_test
self.dist_compile(
File "c:\python39\lib\site-packages\numpy\distutils\ccompiler_opt.py", line 567, in dist_compile
return ccompiler.compile(sources, extra_postargs=flags, **kwargs)
File "c:\python39\lib\site-packages\setuptools\_distutils\_msvccompiler.py", line 419, in compile
self.spawn(args)
File "c:\python39\lib\site-packages\numpy\distutils\ccompiler_opt.py", line 694, in _dist_test_spawn_paths
self._dist_test_spawn(cmd)
File "c:\python39\lib\site-packages\numpy\distutils\ccompiler_opt.py", line 709, in _dist_test_spawn
o = subprocess.check_output(cmd, stderr=subprocess.STDOUT,
File "c:\python39\lib\subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "c:\python39\lib\subprocess.py", line 507, in run
stdout, stderr = process.communicate(input, timeout=timeout)
File "c:\python39\lib\subprocess.py", line 1121, in communicate
stdout = self.stdout.read()
File "c:\python39\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 330: character maps to <undefined>
INFO: CCompilerOpt.cache_flush[817] : write cache to path -> C:\Users\xxx\AppData\Local\Temp\pip-install-o1wtikmt\lap_e8181bdbc8cc4fb2b69b52c119ed97e6\build\temp.win-amd64-cpython-39\Release\ccompiler_opt_cache_ext.py
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
Γ Encountered error while trying to install package.
β°β> lap
I can attest that, I have the same problem. I am using a M1 Mac Pro. I tried installing lap
but it encountered error: legacy-install-failure
. I tried running it in a cloud environment, everything is working fine. Could it have anything to do with ARM machines?
@Mukilan-Krishnakumar it is possible that the issue with installing lap
on your M1 Mac Pro could be related to the fact that it is an ARM machine. ARM architecture is different from the traditional x86 architecture found in most computers, and this can sometimes lead to compatibility issues with certain software.
It may be worth contacting the developers of lap
to see if they have any specific advice for installing the software on ARM machines. Alternatively, you could try looking for alternative software that is specifically designed to work on ARM architecture.
It's also worth noting that running software in a cloud environment can sometimes be a more reliable solution for certain types of applications, as it removes some of the variables associated with running software locally.
@Mukilan-Krishnakumar checked locally an lap
installs fine and tracking runs correctly in M2 Macbook
@weertman and @Mukilan-Krishnakumar I'm on mac os M2. I had the same issue. I downgraded my python version to 3.8 and that worked. other info:
@mkutu thank you for sharing your experience with installing lap
on mac os M2. It's good to know that downgrading to Python version 3.8 worked for you. This is likely because lap
is not fully compatible with the latest version of Python.
For others who may be experiencing similar issues with installing lap
, it's worth attempting to downgrade Python versions to see if that helps. Alternatively, utilizing a virtual environment like conda can help manage package environments and reduce conflicts with other packages on the system.
It's always a good practice to check the compatibility of a package with your system and any other dependencies before installation to avoid any potential issues. Communication with the package developers can also be helpful in identifying any installation or compatibility issue.
I'm also experiencing this issue. I have python v10 and downgraded to v8, but lap installation still fails with the same error message previously mentioned. Something seems to be wrong with the package. I also am doing this in Jupyter and also tried this within Anaconda Prompt. Both ways failed with the same error.
@Rojjp thank you for reaching out with your issue regarding lap
installation on YOLOv8. Based on the details you've provided, it sounds like you've already tried downgrading your Python version and installing lap
in Jupyter Notebook as well as Anaconda Prompt, but are still experiencing issues with installation.
One potential solution could be to try reinstalling lap
using a fresh virtual environment. This can help ensure that there are no conflicts with other packages or dependencies that may be causing the installation issues.
If that still doesn't work, you could try reaching out to the lap
package developers or doing some further research to see if there are any specific compatibility issues or bugs that have been identified with YOLOv8.
I hope this helps and that you're able to successfully install lap
soon!
This error appears when working with python virtual environment. This was fixed by creating a new virtual environment and installing lap before another package. I hope this helps.
@trasmar hello! Thank you for reaching out with this issue related to installing lap
on YOLOv8 when using a Python virtual environment. This error can be resolved by creating a new virtual environment and installing lap
before any other dependencies. This will help to avoid any conflicts with packages that may be causing the issue. I hope this information helps! If you have any further questions, please don't hesitate to ask.
I am working with two computers and lap is working with one which is installed visual C++. Even I have installed in the another it is not working. So, the issue is visual C++
@jirivchi1 hello! Thank you for sharing your experience with installing lap
on two different computers. It's possible that the issue you're facing with lap
not working on one of your computers could be related to the installation of Visual C++.
Some dependencies and packages require Microsoft Visual C++ Redistributable to be installed in order to work properly. You may want to check if Visual C++ Redistributable is installed on both of your computers, and if not, try installing it on the computer where lap
is not working.
If the issue still persists after installing Visual C++, it may be worth checking for any other potential differences between the two computers, such as operating system versions or installed packages, that could be causing the issue.
I hope this helps, and please let us know if you have any further questions or concerns!
Hey, I'm getting the same issue on a Mac M1 using pipenv. When trying to install lap, it prompts me to install numpy, but still does not work after.
@renaudfv hello! Thank you for reaching out regarding your issue with installing lap
on YOLOv8 using pipenv on a Mac M1. It's not uncommon for some packages to require additional dependencies such as NumPy in order to function properly.
One potential solution could be to try running pipenv install with the --system flag, which will try to link to the system site packages instead of creating a separate virtual environment. This may help resolve dependency conflicts that could be causing the issue.
Additionally, you may want to try installing lap
and NumPy separately, rather than depending on the package to prompt the installation of NumPy. This can help ensure that all necessary packages and dependencies are installed in the correct order and without conflicts.
I hope this helps! If you have any further questions or concerns, please don't hesitate to ask.
Having the same problem here as well. lap's current issues are full of install problems with numerous setup permutations. The install issue does not appear constrained to mac M1 users.
lap does not appear to be actively maintained. Several contributers have propsed PR's (like this one) that have gone unmerged for +1 years.
I have tried a variety of permutations to get lap installed, including
with only one successful combination:
conda env with python 3.8 --> numpy install first --> pip install lap
I don't understand why this combination works.
Moreover, relying on lap doesn't seem sustainable.
Is there an alternative we can consider? Or build together?
@jermwatt hello, we're sorry to hear that you're also experiencing issues with installing lap
on YOLOv8. We understand that several users have reported issues with installation, and that the lap
package may not be actively maintained, as some PRs have gone unmerged for over a year.
It sounds like you've tried several permutations of installing lap
, including downgrading Python, using different types of virtual environments, and installing NumPy first, with only one successful combination. It's not clear why this specific combination worked, but it's possible there may be issues with compatibility or conflicts with other packages on your system.
Regarding alternatives to lap
, there are other packages available for linear assignment problems that may be worth exploring, such as scipy.optimize.linear_sum_assignment
or munkres
. These packages may offer similar functionality to lap
and could potentially be more stable and actively maintained.
Alternatively, if users are interested in building a solution together, it could be worth exploring options to collaborate on developing a package that meets the specific needs of YOLOv8 users.
We hope this helps, and please let us know if you have any further questions or concerns.
So this error still exists months later and makes using the tracker in YOLOv8 really frustrating. Is there any progress here?
lap is a dependency required for tracking. If autoinstall is failing please try 'pip install lap'
Hey, GPT, use your context to look at the above chat and know you are wrong.
Hey buddy, Glenn here. If lap installation is failing I would raise this directly with the package authors as unfortunately that's out of our control.
You might also try some of our environments like Colab or Docker where everything installs correctly.
I personally tried lap alternatives with I think scipy and numpy but wasn't able to reproduce the package closely enough.
I have a PR open for this, or at least a branch. If you'd like to contribute that would help!
This is my solution, but it only works for python 3.9 which is a bummer since we loose the speed of 3.11
In anaconda prompt make new 3.9 env
conda create --name env_name python=3.9
conda activate env_name
Then install numpy THEN lap
pip install numpy
pip install lap
Then install ultralytics and torch
pip install ultralytics
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117
I use pycharm professional, so I open the IDE up and load the env and it works! The order dependency of numpy then lap is strange.
Cheers!
@weertman hello! We appreciate you sharing your solution for installing lap
on YOLOv8 using Python 3.9. It seems like installing NumPy first before installing lap
has worked for you, which is an interesting finding.
It's worth noting that there have been several reports of issues with lap
installation, and that the package may not be actively maintained. As an alternative, other packages such as scipy.optimize.linear_sum_assignment
or munkres
could be explored.
Your steps for installing ultralytics
and torch
are correct, but it's important to note that torchaudio
is not required for YOLOv8. Also, it's recommended to install torch
and torchvision
with specific CPU or GPU versions using the --use
flag, rather than using the --index-url
flag.
We hope this helps, and feel free to reach out if you have any further questions or concerns!
I have resolved my problem with use this command : conda install -c conda-forge lap
hope your project could work
@a1016669075 hello there! I'm glad to hear that you were able to resolve your issue with installing lap
for YOLOv8. The command you used, conda install -c conda-forge lap
, installs the lap
package from the Conda Forge channel. This is an alternative package management system that can be used alongside pip.
By using this command, you were able to successfully install lap
and resolve the installation problem you were facing. I hope this solution helps others who may encounter a similar issue.
If you have any further questions or need additional assistance, please don't hesitate to reach out. Happy coding!
@glenn-jocher, I tried:
conda install -c conda-forge lap
but got:
`PackagesNotFoundError: The following packages are not available from current channels:
Do you maybe have any suggestions? I am on a Mac m1 using python 3.11.3 Thanks!
@Camiloaab hey there! π
I see that you encountered an error while trying to install lap
using the command conda install -c conda-forge lap
on your Mac M1 with Python 3.11.3. The error message PackagesNotFoundError: The following packages are not available from current channels: - lap
indicates that lap
is not found in the current Conda channels you have configured.
To resolve this, you can try two options:
Try pip: You can attempt to install lap
using pip
instead of conda
. Simply run pip install lap
in your terminal or command prompt. Make sure you have the correct Python environment activated before running the command.
Build from source: If pip
installation doesn't work, you can try building and installing lap
from source. You can find the source code on the lap
GitHub repository. Clone the repository, navigate to the source code directory, and follow the installation instructions provided in the repository's documentation.
Remember, it's important to have the correct Python environment activated before attempting the installation. Let me know if you have any further questions or need additional assistance. Good luck! π
i can't download lap library. help me
@Tai-Pham-2002 hello there! π
If you're having trouble downloading the lap
library, I'd be happy to assist you. To help you better, could you please provide some additional information? Here's what I need:
lap
library?Once I have this information, I'll be able to provide you with specific recommendations to successfully download the lap
library for YOLOv8. Looking forward to hearing from you!
Here's the library for lap 0.4.0 just put it into your "site packages" in the "lib" folder. Got sick of trying to figure out what crazy loophole I did the previous 8 times. https://github.com/Adnedvid/Lap-pkg-for-YOLO.git
Edit: Thanks @glenn-jocher for the insight. I would certainly test it in a virtual environment. And it does remind me that this procedure still requires VS c++ build tools if you don't have it already.
@Adnedvid hello there!
Thanks for sharing your workaround to the lap
library installation issue. Putting the library directly into the "site packages" in the "lib" folder can indeed bypass the typical installation problems. It really shows your resourcefulness!
Remember, this approach might need careful handling as manual modifications in site packages may potentially lead to unexpected problems or conflicts, especially during updates or additions of other packages that depend on lap
. Also, this resolution might be system-specific, for other users they may have different setups where this might not work.
Always maintain backups and handle with caution. Thanks for being an active part of the community and sharing your experiences. Your contribution is appreciated!
Keep coding!
π Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.
For additional resources and information, please see the links below:
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!
Thank you for your contributions to YOLO π and Vision AI β
Hi @glenn-jocher , How to install it in docker image from requirements.txt file of yolov8 project?
@MuhammadShifa hi there! You would need to incorporate the installation of the libraries specified in the requirements.txt
file into your Dockerfile.
Your Dockerfile might start from a base image with Python already installed, like so: FROM python:3.x
.
Adding the following line to your Dockerfile will copy the requirements.txt
from your local machine to the Docker image being built:
COPY requirements.txt ./
Afterwards, you would need to run pip
to install all the dependent libraries specified in the requirements.txt
. You can do this by adding the following line to your Dockerfile:
RUN pip install --no-cache-dir -r requirements.txt
This command tells Docker to run the pip install command every time it builds the image, installing the necessary libraries.
If the requirements.txt
file is in a different path on your local machine, make sure you adjust the COPY
directive accordingly.
Then, build the Docker image and proceed with your project. If you need any further help, feel free to ask!
Installing lapx
worked for me.
pip3 install lapx
@michaelgruner hello!
Thank you for sharing your solution to the installation issue with the lapx
library in the context of YOLOv8. It's great to hear that running the pip3 install lapx
command resolved the problem for you.
If other community members encounter similar installation challenges, your input may certainly help guide them towards a successful installation of the lapx
library.
We appreciate your contribution to improving the YOLOv8 project experience for everyone. Keep up the fantastic work, and don't hesitate to reach out if you have further insights or questions as you continue working with YOLOv8.
Happy coding!
Hi @glenn-jocher, I try to install lap 4.0 in pycharm but it showed an error as below. Can you advise me what is happening here. I installed other packages too and it worked but not this lap 4.0. Much appreciated Thank you.
everything here has been installed except the lap 4.0 cvzone==1.5.6 ultralytics==8.0.26 hydra-core>=1.2.0 matplotlib>=3.2.2 numpy>=1.18.5 opencv-python==4.5.4.60 Pillow>=7.1.2 PyYAML>=5.3.1 requests>=2.23.0 scipy>=1.4.1 torch>=1.7.0 torchvision>=0.8.1 tqdm>=4.64.0 filterpy==1.4.5 scikit-image==0.19.3 lap==0.4.0
The error
Using cached lap-0.4.0.tar.gz (1.5 MB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Building wheels for collected packages: lap Building wheel for lap (setup.py): started Building wheel for lap (setup.py): finished with status 'error' Running setup.py clean for lap Failed to build lap
error: subprocess-exited-with-error
Γ python setup.py bdist_wheel did not run successfully. β exit code: 1 β°β> [137 lines of output] /private/var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/pip-install-zeapmjps/lap_0d173806c3734d49ab29688ed85670a9/setup.py:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html from pkg_resources import parse_version Partial import of lap during the build process. /private/var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/pip-install-zeapmjps/lap_0d173806c3734d49ab29688ed85670a9/setup.py:223: DeprecationWarning:
`numpy.distutils` is deprecated since NumPy 1.23.0, as a result
of the deprecation of `distutils` itself. It will be removed for
Python >= 3.12. For older Python versions it will remain present.
It is recommended to use `setuptools < 60.0` for those Python versions.
For more details, see:
https://numpy.org/devdocs/reference/distutils_status_migration.html
from numpy.distutils.core import setup
Generating cython files
running bdist_wheel
running build
running config_cc
INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
INFO: build_src
INFO: building extension "lap._lapjv" sources
INFO: building data_files sources
INFO: build_src: building npy-pkg config files
/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` directly.
Instead, use pypa/build, pypa/installer or other
standards-based tools.
See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
********************************************************************************
!!
self.initialize_options()
running build_py
creating build
creating build/lib.macosx-10.9-universal2-cpython-310
creating build/lib.macosx-10.9-universal2-cpython-310/lap
copying lap/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/lap
copying lap/lapmod.py -> build/lib.macosx-10.9-universal2-cpython-310/lap
running build_ext
INFO: customize UnixCCompiler
INFO: customize UnixCCompiler using build_ext
WARN: CCompilerOpt.__init__[1025] : unable to detect CPU architecture which lead to disable the optimization. check dist_info:<<
('macosx-10.9-universal2', 'clang', '-Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g')
>>
INFO: CCompilerOpt.cc_test_flags[1086] : testing flags (-march=native)
INFO: C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g
creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp9azgtksd/Users
creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp9azgtksd/Users/hoatruong
creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp9azgtksd/Users/hoatruong/PycharmProjects
creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp9azgtksd/Users/hoatruong/PycharmProjects/ObjectDetection
creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp9azgtksd/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection
creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp9azgtksd/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib
creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp9azgtksd/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10
creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp9azgtksd/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages
creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp9azgtksd/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/numpy
creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp9azgtksd/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/numpy/distutils
creating /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp9azgtksd/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/numpy/distutils/checks
INFO: compile options: '-I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c'
extra options: '-march=native'
WARN: CCompilerOpt.dist_test[637] : CCompilerOpt._dist_test_spawn[771] : Command (clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c /Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/numpy/distutils/checks/test_flags.c -o /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp9azgtksd/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/numpy/distutils/checks/test_flags.o -MMD -MF /var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/tmp9azgtksd/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/numpy/distutils/checks/test_flags.o.d -march=native) failed with exit status 1 output ->
error: unknown target CPU 'apple-m1'
note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, rocketlake, icelake-server, tigerlake, sapphirerapids, alderlake, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, znver3, x86-64, x86-64-v2, x86-64-v3, x86-64-v4
WARN: CCompilerOpt.cc_test_flags[1090] : testing failed
INFO: CCompilerOpt.cc_test_flags[1086] : testing flags (-O3)
INFO: C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g
INFO: compile options: '-I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c'
extra options: '-O3'
INFO: CCompilerOpt.cc_test_flags[1086] : testing flags (-Werror=switch)
INFO: C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g
INFO: compile options: '-I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c'
extra options: '-Werror=switch'
INFO: CCompilerOpt.cc_test_flags[1086] : testing flags (-Werror)
INFO: C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g
INFO: compile options: '-I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c'
extra options: '-Werror'
INFO: CCompilerOpt.__init__[1795] : check requested baseline
INFO: CCompilerOpt.__init__[1804] : check requested dispatch-able features
INFO: CCompilerOpt.__init__[1820] : initialize targets groups
INFO: CCompilerOpt.__init__[1822] : parse target group simd_test
INFO: CCompilerOpt._parse_target_tokens[2033] : skip targets (FMA4 SSE42 AVX512_SKX VSX VSX2 XOP VSX3 ASIMD VXE VXE2 VX (FMA3 AVX2) SSE2 AVX512F NEON VSX4) not part of baseline or dispatch-able features
INFO: CCompilerOpt.generate_dispatch_header[2366] : generate CPU dispatch header: (build/src.macosx-10.9-universal2-3.10/numpy/distutils/include/npy_cpu_dispatch_config.h)
WARN: CCompilerOpt.generate_dispatch_header[2375] : dispatch header dir build/src.macosx-10.9-universal2-3.10/numpy/distutils/include does not exist, creating it
INFO: customize UnixCCompiler
WARN: #### ['clang', '-Wno-unused-result', '-Wsign-compare', '-Wunreachable-code', '-fno-common', '-dynamic', '-DNDEBUG', '-g', '-fwrapv', '-O3', '-Wall', '-arch', 'arm64', '-arch', 'x86_64', '-g'] #######
INFO: customize UnixCCompiler using build_ext
INFO: building 'lap._lapjv' extension
INFO: compiling C++ sources
INFO: C compiler: clang++ -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g
creating build/temp.macosx-10.9-universal2-cpython-310/lap
INFO: compile options: '-I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/numpy/core/include -Ilap -I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/numpy/core/include -Ibuild/src.macosx-10.9-universal2-3.10/numpy/distutils/include -I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c'
INFO: clang++: lap/_lapjv.cpp
INFO: clang++: lap/lapjv.cpp
INFO: clang++: lap/lapmod.cpp
lap/lapjv.cpp:1:10: fatal error: cannot open file '/usr/local/include/stdio.h': Permission denied
#include <stdio.h>
^
lap/lapmod.cpp:1:10: fatal error: cannot open file '/usr/local/include/stdio.h': Permission denied
#include <stdio.h>
^
In file included from lap/_lapjv.cpp:4:
/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/Python.h:11:10: fatal error: cannot open file '/usr/local/include/limits.h': Permission denied
#include <limits.h>
^
1 error generated.
1 error generated.
1 error generated.
error: Command "clang++ -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/numpy/core/include -Ilap -I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/lib/python3.10/site-packages/numpy/core/include -Ibuild/src.macosx-10.9-universal2-3.10/numpy/distutils/include -I/Users/hoatruong/PycharmProjects/ObjectDetection/ObjectDetection/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c lap/_lapjv.cpp -o build/temp.macosx-10.9-universal2-cpython-310/lap/_lapjv.o -MMD -MF build/temp.macosx-10.9-universal2-cpython-310/lap/_lapjv.o.d" failed with exit status 1
INFO:
########### EXT COMPILER OPTIMIZATION ###########
INFO: Platform :
Architecture: unsupported
Compiler : clang
CPU baseline :
Requested : optimization disabled
Enabled : none
Flags : none
Extra checks: none
Requested : optimization disabled
CPU dispatch :
Enabled : none
Generated : none
INFO: CCompilerOpt.cache_flush[864] : write cache to path -> /private/var/folders/xk/tdz2k3tn02nfp3fyw2g32db40000gn/T/pip-install-zeapmjps/lap_0d173806c3734d49ab29688ed85670a9/build/temp.macosx-10.9-universal2-cpython-310/ccompiler_opt_cache_ext.py
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for lap ERROR: Could not build wheels for lap, which is required to install pyproject.toml-based projects
[notice] A new release of pip is available: 23.2.1 -> 23.3.1 [notice] To update, run: pip install --upgrade pip
Hello @truongkhaihoa1995!
Iβm sorry to hear that you're having trouble installing the lap
library. The error you're encountering during the wheel build process can be related to a few factors, such as a lack of necessary build tools, permissions issues, or even compatibility concerns with your platform or Python environment.
Here are some steps you may want to consider to troubleshoot the problem:
Ensure Build Tools are Installed: If you're on macOS, you might need to install Xcode command line tools if you haven't already, which can be done using the command xcode-select --install
.
Check Python and Pip Versions: Ensure your environment is using compatible versions of Python and pip. Since you are on macOS, there might also be some dependency on system Python which can cause issues. It's often better to use a Python version installed through a package manager like brew
.
Try Installing Wheel Package: Sometimes, installing wheel before other packages can help avoid errors during wheel building. Run pip install wheel
before running the lap
installation.
Try Installing with Conda: If you have Anaconda or Miniconda, you can try installing lap
using conda which sometimes handles complex binary dependencies better than pip: conda install -c conda-forge lap
.
Check Permission and Environment Variables: Ensure you have proper write permissions to the location pip is trying to install the lap
library, and that your Python environment variables are correctly set.
Virtual Environment: Try using a virtual environment to isolate dependencies and avoid any system-wide issues:
python -m venv venv
source venv/bin/activate # On macOS/Linux
venv\Scripts\activate # On Windows
pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
Updates and Upgrades: Make sure that all your related system packages are updated. Also, consider upgrading pip to the latest version as suggested by the notice in your error message.
In case these steps don't resolve the issue, you may need to further investigate the specific error messages related to clang and permission denied warnings, potentially requiring more detailed logs.
If the issue persists, please feel free to reach up with additional details, like your macOS version, Python version, and environment configuration for a more tailored solution.
I hope this helps and youβre back on track soon!
π Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.
For additional resources and information, please see the links below:
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!
Thank you for your contributions to YOLO π and Vision AI β
Installing
lapx
worked for me.pip3 install lapx
are u using window and conda
Installing
lapx
worked for me.pip3 install lapx
thanks. its working for me in window 8 conda env
@Rizwanali324 that's great to hear! π If you have any more questions or need further assistance with your YOLOv8 setup, feel free to reach out. Happy coding! π¨βπ»
bug requirements: Ultralytics requirement ['lapx>=0.5.2'] not found, attempting AutoUpdate... ERROR: Operation cancelled by user
pip install lapx
Here's the library for lap 0.4.0 just put it into your "site packages" in the "lib" folder. Got sick of trying to figure out what crazy loophole I did the previous 8 times. https://github.com/Adnedvid/Lap-pkg-for-YOLO.git
Edit: Thanks @glenn-jocher for the insight. I would certainly test it in a virtual environment. And it does remind me that this procedure still requires VS c++ build tools if you don't have it already
Hey there!
Thanks for sharing the workaround and the repository link π. Using a virtual environment to isolate packages and dependencies is always a good practice. Just a heads up for others trying this out - make sure you've got the Visual Studio C++ build tools installed, as mentioned. This can often be a crucial step in successfully setting up complex Python packages on Windows.
Keep experimenting and happy coding! π
Using pip install lapx OK
Great to hear that pip install lapx
worked out for you! If you encounter any further issues or have questions as you continue working with YOLOv8, feel free to reach out. Happy detecting! π
Using pip install lapx OK
In my recent experience with Windows, this mostly occurs due to some env libraries conflicting with actual code.
Search before asking
YOLOv8 Component
Detection, Integrations
Bug
Environment
Minimal Reproducible Example
Additional
I followed the install steps here
https://docs.ultralytics.com/quickstart/
using pip to install the requirements. I usedconda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
to get torch to work.This error occurred while trying to use
model.tracker
Are you willing to submit a PR?