failed to build image on macos M1: gcc: error: missing argument to ‘-march=’ - macos

when building image on macos with M1, i got an error below:
Collecting python-Levenshtein==0.12.2
Using cached python-Levenshtein-0.12.2.tar.gz (50 kB)
Requirement already satisfied: setuptools in /usr/local/lib/python3.6/site-packages (from python-Levenshtein==0.12.2) (33.1.1)
Using legacy 'setup.py install' for python-Levenshtein, since package 'wheel' is not installed.
Installing collected packages: python-Levenshtein
Running setup.py install for python-Levenshtein ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3.6 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-z9yhh5ds/python-levenshtein_e99c5f8b2a70415d998d3534a8b15e14/setup.py'"'"'; __file__='"'"'/tmp/pip-install-z9yhh5ds/python-levenshtein_e99c5f8b2a70415d998d3534a8b15e14/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-60fgubma/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6m/python-Levenshtein
cwd: /tmp/pip-install-z9yhh5ds/python-levenshtein_e99c5f8b2a70415d998d3534a8b15e14/
Complete output (31 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/Levenshtein
copying Levenshtein/StringMatcher.py -> build/lib.linux-x86_64-3.6/Levenshtein
copying Levenshtein/__init__.py -> build/lib.linux-x86_64-3.6/Levenshtein
running egg_info
writing python_Levenshtein.egg-info/PKG-INFO
writing dependency_links to python_Levenshtein.egg-info/dependency_links.txt
writing entry points to python_Levenshtein.egg-info/entry_points.txt
writing namespace_packages to python_Levenshtein.egg-info/namespace_packages.txt
writing requirements to python_Levenshtein.egg-info/requires.txt
writing top-level names to python_Levenshtein.egg-info/top_level.txt
reading manifest file 'python_Levenshtein.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*pyc' found anywhere in distribution
warning: no previously-included files matching '*so' found anywhere in distribution
warning: no previously-included files matching '.project' found anywhere in distribution
warning: no previously-included files matching '.pydevproject' found anywhere in distribution
writing manifest file 'python_Levenshtein.egg-info/SOURCES.txt'
copying Levenshtein/_levenshtein.c -> build/lib.linux-x86_64-3.6/Levenshtein
copying Levenshtein/_levenshtein.h -> build/lib.linux-x86_64-3.6/Levenshtein
running build_ext
building 'Levenshtein._levenshtein' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/Levenshtein
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python3.6m -c Levenshtein/_levenshtein.c -o build/temp.linux-x86_64-3.6/Levenshtein/_levenshtein.o
gcc: error: missing argument to ‘-march=’
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python3.6 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-z9yhh5ds/python-levenshtein_e99c5f8b2a70415d998d3534a8b15e14/setup.py'"'"'; __file__='"'"'/tmp/pip-install-z9yhh5ds/python-levenshtein_e99c5f8b2a70415d998d3534a8b15e14/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-60fgubma/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6m/python-Levenshtein Check the logs for full command output.
My Dockerfile is :
FROM ***:21.06.22.1038
# install related packages
COPY target/requirements.txt /root/requirements.txt
RUN pip3 install -r /root/requirements.txt -i https://pypi.douban.com/simple/
And my requirements.txt is:
pymysql
requests==2.21.0
xlrd==1.2.0
tornado==5.1.1
pypinyin==0.35.3
python-Levenshtein==0.12.2
thrift==0.13.0
jieba==0.42.1
Cython==0.28.5
elasticsearch==7.13.1
scikit-learn==0.18.2
ConcurrentLogHandler==0.9.1
tormysql==0.4.2
truepy==2.0.4
redis==3.0.1
redis-py-cluster==2.0.0
The version of my base image is python3.6.8, and if i delete python-Levenshtein==0.12.2 from requirements.txt, it will success.
i`ve already installed:
wget aclocal automake autoconf make gcc gcc-c++ python3-devel mysql-devel bzip2 libffi-devel openssl-devel epel-release python3-pip python3-setuptools python3-libs
in my base image.

Related

pip install lapjv failed

I installed under Python 3.6.13
I tried to install build tools or even uninstall VS and then reinstall it, but it didn't work. This problem always exists.
Running setup.py clean for lapjv
Failed to build lapjv
Installing collected packages: lapjv
Running setup.py install for lapjv ... error
ERROR: Command errored out with exit status 1:
command: 'C:\ProgramData\Anaconda3\envs\DeepBindff\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Acer\\AppData\\Local\\Temp\\pip-install-lrnqbqb1\\lapjv_d7aa7e022bf14ef3b147d3c1a5d
34efe\\setup.py'"'"'; __file__='"'"'C:\\Users\\Acer\\AppData\\Local\\Temp\\pip-install-lrnqbqb1\\lapjv_d7aa7e022bf14ef3b147d3c1a5d34efe\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file_
_) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Acer\AppData\Local\Temp
\pip-record-pyjon60w\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\ProgramData\Anaconda3\envs\DeepBindff\Include\lapjv'
cwd: C:\Users\Acer\AppData\Local\Temp\pip-install-lrnqbqb1\lapjv_d7aa7e022bf14ef3b147d3c1a5d34efe\
Complete output (5 lines):
running install
running build
running build_ext
building 'lapjv' 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: Command errored out with exit status 1: 'C:\ProgramData\Anaconda3\envs\DeepBindff\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Acer\\AppData\\Local\\Temp\\pip-install-lrnqbqb1\\
lapjv_d7aa7e022bf14ef3b147d3c1a5d34efe\\setup.py'"'"'; __file__='"'"'C:\\Users\\Acer\\AppData\\Local\\Temp\\pip-install-lrnqbqb1\\lapjv_d7aa7e022bf14ef3b147d3c1a5d34efe\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__
file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record
'C:\Users\Acer\AppData\Local\Temp\pip-record-pyjon60w\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\ProgramData\Anaconda3\envs\DeepBindff\Include\lapjv' Check the logs for full command out
put.

pip install error when I install fbprophet

(I'm not good at English sorry)
I have an error when I install fbprophet for windows command.
I already installed pystan and cython.
I use Windows 10, python 3.9 version.
maybe, Am I having a problem with the compiler?
The error comment is (korea language in error is not really important thing), -->
=== error in building with wheel ===
ERROR: Command errored out with exit status 1:
command: 'c:\users\kstar\appdata\local\programs\python\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\kstar\AppData\Local\Temp\pip-install-la81h33s\fbprophet_b85d314a94fb4910b19f0b36b012fb78\setup.py'"'"'; file='"'"'C:\Users\kstar\AppData\Local\Temp\pip-install-la81h33s\fbprophet_b85d314a94fb4910b19f0b36b012fb78\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\kstar\AppData\Local\Temp\pip-wheel-b98qkky1'
cwd: C:\Users\kstar\AppData\Local\Temp\pip-install-la81h33s\fbprophet_b85d314a94fb4910b19f0b36b012fb78
Complete output (44 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib
creating build\lib\fbprophet
creating build\lib\fbprophet\stan_model
Traceback (most recent call last):
.
.
.
=== error in running setup.py ===
ERROR: Command errored out with exit status 1:
command: c:\users\kstar\appdata\local\programs\python\python39\python.exe -u -c import io, os, sys, setuptools, tokenize; sys.argv[0] = C:\Users\kstar\AppData\Local\Temp\pip-install-la81h33s\fbprophet_b85d314a94fb4910b19f0b36b012fb78\setup.py; file=C:\Users\kstar\AppData\Local\Temp\pip-install-la81h33s\fbprophet_b85d314a94fb4910b19f0b36b012fb78\setup.py;f = getattr(tokenize, '"'"'open, open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup());code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\kstar\AppData\Local\Temp\pip-record-avm6oqpp\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\kstar\appdata\local\programs\python\python39\Include\fbprophet'
cwd: C:\Users\kstar\AppData\Local\Temp\pip-install-la81h33s\fbprophet_b85d314a94fb4910b19f0b36b012fb78
Complete output (288 lines):
running install
running build
running build_py
creating build
creating build\lib
creating build\lib\fbprophet
creating build\lib\fbprophet\stan_model
INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_f5236004a3fd5b8429270d00efcc0cf9 NOW.
WARNING:pystan:MSVC compiler is not supported
stanfit4anon_model_f5236004a3fd5b8429270d00efcc0cf9_296405994888268896.cpp
c:\users\kstar\appdata\local\programs\python\python39\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
following has worked for me before:
pip install localpip
localpip install fbprophet
from fbprophet import Prophet

Command errored out with exit status 1 on mac while installing odoo

command: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/d1/qbs5yr054qb2w8kk6dmwzz9r0000gn/T/pip-install-cu02imcv/psycopg2/setup.py'"'"'; _file='"'"'/private/var/folders/d1/qbs5yr054qb2w8kk6dmwzz9r0000gn/T/pip-install-cu02imcv/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, _file, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /private/var/folders/d1/qbs5yr054qb2w8kk6dmwzz9r0000gn/T/pip-install-cu02imcv/psycopg2/
Complete output (23 lines):
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
Error: pg_config executable not found.
pg_config is required to build psycopg2 from source. Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.
For further information please check the 'doc/src/install.rst' file (also at
<http://initd.org/psycopg/docs/install.html>).
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
install pg_config first and then try again.
Run this brew command first:
brew install postgresql
Then reinstall again.

PKG_CONFIG_PATH environment variable (install ipopt error)

I tried to install ipopt trough pip install ipopt
Here is my error:
Collecting ipopt
Using cached ipopt-0.2.0.tar.gz (162 kB)
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/3w/zf3x85h55tv7qk2yg8ykztwc0000gn/T/pip-install-i9o4pqdg/ipopt/setup.py'"'"'; __file__='"'"'/private/var/folders/3w/zf3x85h55tv7qk2yg8ykztwc0000gn/T/pip-install-i9o4pqdg/ipopt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/3w/zf3x85h55tv7qk2yg8ykztwc0000gn/T/pip-pip-egg-info-_gej3ysb
cwd: /private/var/folders/3w/zf3x85h55tv7qk2yg8ykztwc0000gn/T/pip-install-i9o4pqdg/ipopt/
Complete output (11 lines):
Package ipopt was not found in the pkg-config search path.
Perhaps you should add the directory containing `ipopt.pc'
to the PKG_CONFIG_PATH environment variable
No package 'ipopt' found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/3w/zf3x85h55tv7qk2yg8ykztwc0000gn/T/pip-install-i9o4pqdg/ipopt/setup.py", line 102, in <module>
**pkgconfig('ipopt'))]
File "/private/var/folders/3w/zf3x85h55tv7qk2yg8ykztwc0000gn/T/pip-install-i9o4pqdg/ipopt/setup.py", line 58, in pkgconfig
raise OSError(msg.format(list(packages)))
OSError: pkg-config was not able to find any of the requested packages ['ipopt'] on your system. Make sure pkg-config can discover the .pc files associated with the installed packages.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Command pkg-config --variable pc_path pkg-config gives:
/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.15
Made this (but I think that the link is strange), but didn't solve the problem
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.15
You must the following commands:
sudo apt-get install gcc g++ gfortran git patch wget pkg-config liblapack-dev libmetis-dev

Errors in downloading the python modules using pip

often I face the same error during downloading the python modules using pip. Could you guys help me sort this out? FYI I am using python 3.7v.
C:\>pip install PyAudio
Collecting PyAudio
Downloading https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Building wheels for collected packages: PyAudio
Running setup.py bdist_wheel for PyAudio ... error
Complete output from command c:\users\avinash.tripathy\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\AVINAS~1.TRI\\AppData\\Local\\Temp\\pip-install-_qfc03y7\\PyAudio\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\AVINAS~1.TRI\AppData\Local\Temp\pip-wheel-fjb2zkz4 --python-tag cp37:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win32-3.7
copying src\pyaudio.py -> build\lib.win32-3.7
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Failed building wheel for PyAudio
Running setup.py clean for PyAudio
Failed to build PyAudio
Installing collected packages: PyAudio
Running setup.py install for PyAudio ... error
Complete output from command c:\users\avinash.tripathy\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\AVINAS~1.TRI\\AppData\\Local\\Temp\\pip-install-_qfc03y7\\PyAudio\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\AVINAS~1.TRI\AppData\Local\Temp\pip-record-h2e_hkyb\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
copying src\pyaudio.py -> build\lib.win32-3.7
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Command "c:\users\avinash.tripathy\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\AVINAS~1.TRI\\AppData\\Local\\Temp\\pip-install-_qfc03y7\\PyAudio\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\AVINAS~1.TRI\AppData\Local\Temp\pip-record-h2e_hkyb\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\AVINAS~1.TRI\AppData\Local\Temp\pip-install-_qfc03y7\PyAudio\
It doesn't look like PyAudio has a binary package available under pip. Christoph Gohlke maintains Unofficial Windows Binaries for Python Extension Packages and it has PyAudio. Download an appropriate version, then install it directly with pip install.

Resources