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

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.

Related

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

How to use pip-tools to install from a github repo?

Here is a line in a req.in file (for pip-compile) to get a package from a github repository:
-e git://github.com/dfrankow/django-editorjs-fields.git#egg=django-editorjs-fields
Running pip-compile req.in gives a req.txt with
-e git+git://github.com/dfrankow/django-editorjs-fields.git#egg=django-editorjs-fields
Using pip to install (pip install -r req.txt) gives this error:
ERROR: Command errored out with exit status 1:
command: .../.venv/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'.../.venv/src/django-editorjs-fields/setup.py'"'"'; __file__='"'"'.../.venv/src/django-editorjs-fields/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'"'"'))' develop --no-deps
cwd: .../.venv/src/django-editorjs-fields/
Complete output (3 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'setuptools'
I have setuptools (and in fact all the other libraries) installed. See, no errors:
$ .venv/bin/python -c 'import io, os, sys, setuptools, tokenize;'
$
If I install directly (without the -e) it works:
$ pip install git+git://github.com/dfrankow/django-editorjs-fields.git#egg=django-editorjs-fields
... (works)
But when I take the -e out of req.in, pip-compile complains:
$ pip-compile req.in
...
pip._internal.exceptions.InstallationError: Invalid requirement: 'git://github.com/dfrankow/django-editorjs-fields.git#egg=django-editorjs-fields' (from line 1 of req.in)
Hint: It looks like a path. File 'git://github.com/dfrankow/django-editorjs-fields.git#egg=django-editorjs-fields' does not exist.
What the heck, I'm trapped.
How do I put a github repo into req.in, compile it with pip-compile into req.txt, and pip install req.txt without errors?
I need it to work automatically because we have a toolchain that depends on it (github workflows, dependabot, ..).
I'm using python 3.9.1_2, pip 21.1.2, pip-tools 6.2.0 on OS X. Also happened with pip-tools 6.0.1 (not surprising).

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

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.

Receiving an error when installing MariaDB via pip3 [duplicate]

This question already has answers here:
Python MariaDB pip install failed, missing mariadb_config
(3 answers)
Closed 2 years ago.
Im receiving an error when installing mairadb via pip3. Below is the command and error.
sudo pip3 install mariadb
------------------------------------------------------------------
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting mariadb
Using cached mariadb-1.0.0.tar.gz (78 kB)
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-z5vslgxx/mariadb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-z5vslgxx/mariadb/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 /tmp/pip-pip-egg-info-hfv4vge6
cwd: /tmp/pip-install-z5vslgxx/mariadb/
Complete output (12 lines):
/bin/sh: 1: mariadb_config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-z5vslgxx/mariadb/setup.py", line 26, in <module>
cfg = get_config(options)
File "/tmp/pip-install-z5vslgxx/mariadb/mariadb_posix.py", line 49, in get_config
cc_version = mariadb_config(config_prg, "cc_version")
File "/tmp/pip-install-z5vslgxx/mariadb/mariadb_posix.py", line 26, in mariadb_config
raise EnvironmentError(
OSError: mariadb_config not found.
Please make sure, that MariaDB Connector/C is installed on your system, edit the configuration file 'site.cfg' and set the 'mariadb_config'
option, which should point to the mariadb_config utility.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I have updated setuptools for pip via sudo pip3 install --upgrade setuptools to no avail. This error also occurs when trying to install most sql related modules for example mysql.
I am now able to install MariaDB 1.0.0 connector with no issues now. If you are receiving an OS error, install the mariadbclient-dev package with sudo apt-get install libmariadbclient-dev then you can install with pip3 install mariadb.

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

Resources