ERROR: Failed building wheel for dlib on MacOS Catalina - python

I'm trying to get eye tracking on python. I've installed openCV and everything required except dlib. When I first tried it, It just went into a "Building wheel for setup.py" Loop. I've looked around on stackoverflow and I tried following This Tutorial to install it with homebrew, and I've tried using This to log all the errors. By doing this I see a lot of warnings, but it gets to about 98% before failing and trying again. Here's what I'm using:
MacOS Catalina Version 10.15.7
Visual studio 2019(although I don't know if that matters)
Python 3.8
I have CMAKE version 3.18.2(when running cmake --version)
If it helps, when I do pip install cmake it says it's already installed for python3.5, but will work for python 3.8.
Any tips would be appreciated. I can give more info aswell

Related

Pip Errors Out When Installing Anything

I've run into an odd issue where pip just won't work. I'm using the latest version of PyCharm, and I've tried both Python 3.8.10 and 3.9.6.
I've done clean installations of both, removed from PATH, reinstalled with new installer, reinstalled pip, etc.
The error code I run into appears no matter what library I am trying to download. I've tried PyAudio, PyGame, OpenCV-Python and others.
Pip was working fine a couple days ago, and no changes have been made to any files in that time.
Attempting to run pip install --upgrade pip does not have an effect.
I've been running off virtual enviroments with setuptools 40.8.0 and pip 21.1.3 installed.
The full error for installing PyAudio can be seen here: https://pastebin.com/iQmZwsRv
PyGame error: https://pastebin.com/WEF8uM2d
OpenCV-Python Error: https://pastebin.com/LuZq99Cu
Py- audio - it's not compatible with your Py charm I suppose due to the latest install updates, try to install it on the main environment. Also, try to downgrade your version of python as many dependencies are not compatible with your version of python as stated by error[it is not compatible with this Python]
Open Cv - Fails to build the wheel package as it is attributed also in error [CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.]
May I know what build tool are you using?

How to fix Illegal Instruction: 4 when trying to run a python file in MacOS?

I am trying to install dlib and run the code from here.
After installing dlib when I execute the line
python detect_face_features.py --shape-predictor shape_predictor_68_face_landmarks.dat --image images/image_1.jpg
I get the error
Illegal instruction: 4
I tried creating a virtual environment first and install dlib and opencv. The files get imported but on running the code on python I get the same error. I clean installed it on my root environment but still the same error. I can't figure out what library or file is broken as other python files work as expected.
I am working on MacOS 10.11.6 with XCode version 8.2.1
I installed the dlib with reference to this site.
Please tell me how to fix this. Thank you.
Edit: My MacBook is of mid 2010 build and it doesn't have AVX instructions built into it. I tried installing dlib again by explicitly switching off AVX instructions but the problem still persists.
sudo python3 setup.py install --no USE_AVX_INSTRUCTIONS
I also tried this solution but couldn't find the line
set(USE_SSE4_INSTRUCTIONS ON CACHE BOOL "Use SSE4 instructions")
on dlib's path tools/python/CMakeLists.txt
Please tell me how can I fix this issue.
Thank You.

XMLSEC installation error, Windows-7

Im trying to install xmlsec (with pip) but it is throwing: error: pkg-config is not installed. Im using Python3.6 on windows 7.
Thanks in advance for any suggestion.
Xmlsec has some issues with windows but as with python 3.6 and below the problem is solved. Use this link to download the wheel file for your python version https://github.com/mehcode/python-xmlsec/releases
Install the wheel file using
pip install <wheel_file_name>
As with Python 3.7, the only way out is to install xmlsec on a Linux machine as it is not yet supported on Windows.
This seems to be a problem on Windows #Jcc.Sanabria on Windows. Where as Linux & MAC are seems to be working for xmlsec.
Since I had gone through this situations for around weeks now.
Going through official Document
here I didn't find any instruction on "How to install this on Windows?"
To answer your question :
Resolve your exception related with pkgconfig you can use this link on Windows.
But then it will also ask you to install Visual C++ (>=ver. 14.0) but after installing this too.
You will face exception like this one :
"cl : Command line error D8021 : invalid numeric argument '/Wno-error=declaration-after-statement'
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2"
Which I didn't find any resolution till now. :(
But to use xmlsec and python on Windows working you need to take support from Cygwin. Where you can install all related packages from Cygwin Packages list for python and xmlsec dependancy. Following are the name & version of some packages :
gettext-devel(0.19.8.1-2),libglib2.0-devel(2.50.3-1),libxml2-devel(2.9.4-2),libxmlsec1-devel(1.2.24-1),libxslt-devel(1.1.29-1)
Further dependency can be checked on this link

Setuptools error when trying to install a package

I’m completely new to Python and I want to install the package py-webrtcvad in Windows 7, but I'm stuck at the error ImportError: No module named 'pip.utils.setuptools_build'. There is an answer to this problem in stackoverflow which seems to solve the problem for others, but it doesn't work for me.
Here’s a summary of what I’ve done and tried so far:
Installed Python 3.5 and set up the Windows path environment so
that it works from any directory.
Installed pip for Python.
Tried to install the package with python -m pip install webrtcvad,
but it failed, returning the error Unable to find vcvarsall.bat.
I found a blog that deals with the vcvarsall.bat
problem: blogs.msdn.microsoft.com/pythonengineering/2016/04/11/unable-to-find-vcvarsall-bat. Following the directions of that blog:
First I just installed Visual C++ Build Tools 2015 and tried installing the package straight away (without updating setuptools), but I received a lot of error messages (which I didn’t write down).
I tried reinstalling setuptools, which I did following the directions in https://pypi.python.org/pypi/setuptools: I removed the version of setuptools that came with my Python installation (v20), and installed the latest version (v30). This time I got a different error message when trying to install py-webrtcvad: ImportError: No module named 'pip.utils.setuptools_build'.
Asked for assistance in the Python official chat. They made three
suggestions:
Updating pip with python -m pip install --upgrade pip. Didn’t
work. Again, the error ImportError: No module named 'pip.utils.setuptools_build'.
Reinstalling Visual C++ Build Tools 2015. No difference, same error
again.
Reinstalling Python itself. The Python installer offers three
choices: Repair, modify and uninstall.
Repair: Didn’t work. Same error.
Modify: Doesn’t look like it offers useful modifications for this.
Uninstall: Uninstalled and reinstalled. Still the same error.
I’m out of ideas. Can you help me?
Note: I imagine this should be doable in Windows 7 with Python 3.5. However, if it isn't I'm open to trying anything different. For example, installing a different version of Python would be no problem at all. I could also try installing Linux if that will solve the problem.
There was a bug in version 2.0.8 of webrtcvad that caused it to use the wrong flags when compiling for Windows: it was using -DWEBRTC_POSIX instead of -DWIN32. This might have been the source of the "lot of error messages" you got during one of your early attempts.
The fixed version has been pushed to pypi as version 2.0.9. I've confirmed that pip install webrtcvad works correctly on Windows 10. I'm using a pretty fresh install of Python, so I would try it first without reinstalling setuptools.

Python(x,y): MinGW installation - MWE

Background
I reinstalled Python(x,y) on my Windows 7 machine. When I finished the installation I wanted to upgrade all packages using pip. But the mingw compiler gives some weird error messages.
My last question could hopefully get resolved by this issue: Python: Install sip
Therefore I checked out an example online that builds C code for Python using mingw. But it failed - that might be an indication that mingw is not working as intended. I have some details if this helps anything:
mingw32-make --version 3.82.90
gcc --version 4.8.1
python --version 2.7.10
I configured Python (C:\Python27\Lib\distutils\distutils.cfg) according to the qutip installation guide and https://docs.python.org/2/install/#location-and-names-of-config-files.
Issue
I want to test my mingw installation since I cannot upgrade the Python packages with pip. Please give me some tested code to check if my installation is working properly together with Python.

Categories

Resources