AirFlow error while installing it on CentOS7 - python-2.7

I am trying to install Apache AirFlow on my local machine CentOS7.
I have python 2.7.
I am getting below error while installing AirFlow
[dsawale#localhost ~]$ pip install apache-airflow==1.10.9
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
Collecting apache-airflow==1.10.9
Using cached apache_airflow-1.10.9-py2.py3-none-any.whl (4.6 MB)
Collecting flask-appbuilder<2.0.0,>=1.12.2; python_version < "3.6"
Downloading Flask-AppBuilder-1.13.1.tar.gz (1.5 MB)
|████████████████████████████████| 1.5 MB 742 kB/s
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-D2TCrh/flask-appbuilder/setup.py'"'"'; __file__='"'"'/tmp/pip-install-D2TCrh/flask-appbuilder/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-pNlWPA
cwd: /tmp/pip-install-D2TCrh/flask-appbuilder/
Complete output (3 lines):
/usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
error in Flask-AppBuilder setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Could you please help me to resole this issue?
Thanks!

Please upgrade setuptools using below.
pip install --upgrade setuptools
Please let me know.

Related

How shoud I fix ERROR with pip install psycopg2==2.7.*?

I am trying to put my app that I created on server www using heroku. But when I put to my terminal on Ubuntu pip install psycopg2==2.7.*, I get this error:
ERROR: Command errored out with exit status 1:
command: /home/marcin/Python/learning_log/ll_env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-c67buptz/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-c67buptz/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 /tmp/pip-install-c67buptz/psycopg2/pip-egg-info
cwd: /tmp/pip-install-c67buptz/psycopg2/
Complete output (28 lines):
running egg_info
creating /tmp/pip-install-c67buptz/psycopg2/pip-egg-info/psycopg2.egg-info
writing /tmp/pip-install-c67buptz/psycopg2/pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-install-c67buptz/psycopg2/pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing top-level names to /tmp/pip-install-c67buptz/psycopg2/pip-egg-info/psycopg2.egg-info/top_level.txt
writing manifest file '/tmp/pip-install-c67buptz/psycopg2/pip-egg-info/psycopg2.egg-info/SOURCES.txt'
/home/marcin/Python/learning_log/ll_env/lib/python3.8/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
/home/marcin/Python/learning_log/ll_env/lib/python3.8/site-packages/setuptools/command/egg_info.py:643: SetuptoolsDeprecationWarning: Custom 'build_py' does not implement 'get_data_files_without_manifest'.
Please extend command classes from setuptools instead of distutils.
warnings.warn(
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.
What should I do?
You need some dependencies check this answer
https://stackoverflow.com/a/46877364/15208727
sudo apt install libpq-dev python3-dev
You should install pscopg2-binary and the push to heroku
pip install psycopg2-binary or pipenv install psycopg2-binary depending on your virtualenv

Unable to install mod_wsgi package

I am trying to install mod_wsgi package using pip , in amazon linux 2 instance, but I keep facing an error:
Command:
python3 -m pip install mod_wsgi
OUTPUT/ERROR:
Defaulting to user installation because normal site-packages is not writeable
Collecting mod_wsgi
Using cached mod_wsgi-4.9.0.tar.gz (497 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2sfljsxd/mod-wsgi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2sfljsxd/mod-wsgi/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-54w0mlq7
cwd: /tmp/pip-install-2sfljsxd/mod-wsgi/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-2sfljsxd/mod-wsgi/setup.py", line 91, in <module>
'missing Apache httpd server packages.' % APXS)
RuntimeError: The 'apxs' command appears not to be installed or is not executable. Please check the list of prerequisites in the documentation for this package and install any missing Apache httpd server packages.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Steps taken trying to resolve the error:
1.I tried running python setup.py egg_info, but kept getting the error setup.py doesnt exist
2.I tried finding setup.py , using the command find . -name setup.py, but nothing was returned
How do I solve this?
PS: I know you are only supposed to ask one question at a time but, if there is any tutorial that explains how to use apache and mod_wsgi , to launch a django project on ec2 instance on aws, please do link it, would highly appreciate it
Thank you!

Getting an error while trying to install robotframework-appiumlibrary

Mac OS - 10.15.7
Python - 2.7.18
I used the command to install "pip install robotframework-appiumlibrary" and following is the error i get.
#Amiths-MacBook-Pro ~ % pip install robotframework-appiumlibrary
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting robotframework-appiumlibrary
Using cached robotframework_appiumlibrary-1.5.0.7-py2.py3-none-any.whl (49 kB)
Collecting docutils>=0.8.1
Using cached docutils-0.17.1-py2.py3-none-any.whl (575 kB)
Collecting six>=1.10.0
Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting decorator>=3.3.2
Using cached decorator-4.4.2-py2.py3-none-any.whl (9.2 kB)
Collecting kitchen>=1.2.4
Using cached kitchen-1.2.6.tar.gz (255 kB)
Collecting selenium>=2.47.1
Using cached selenium-3.141.0-py2.py3-none-any.whl (904 kB)
Requirement already satisfied: robotframework>=2.6.0 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from robotframework-appiumlibrary) (4.0.1)
Collecting Appium-Python-Client>=0.28
Using cached Appium-Python-Client-1.1.0.tar.gz (53 kB)
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xn/c052lddx4qz1lm8h6thg0w_h0000gn/T/pip-install-IQfrSA/appium-python-client/setup.py'"'"'; __file__='"'"'/private/var/folders/xn/c052lddx4qz1lm8h6thg0w_h0000gn/T/pip-install-IQfrSA/appium-python-client/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/xn/c052lddx4qz1lm8h6thg0w_h0000gn/T/pip-pip-egg-info-AVKVXp
cwd: /private/var/folders/xn/c052lddx4qz1lm8h6thg0w_h0000gn/T/pip-install-IQfrSA/appium-python-client/
Complete output (8 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/xn/c052lddx4qz1lm8h6thg0w_h0000gn/T/pip-install-IQfrSA/appium-python-client/setup.py", line 19, in <module>
from appium.common.helper import library_version
File "appium/common/helper.py", line 20
def extract_const_attributes(cls: type) -> Dict[str, Any]:
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
#Amiths-MacBook-Pro ~ % python setup.py egg_info
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'setup.py': [Errno 2] No such file or directory

Error while attempting to pip install psycopg2==2.7.*

I'm trying to run the package, pip install psycopg2==2.7.* ,on my PyCharm terminal so I can deploy my site but I get the message that appears below
Collecting psycopg2
Using cached https://files.pythonhosted.org/packages/a8/8f/1c5690eebf148d1d1554fc00ccf9101e134636553dbb75bdfef4f85d7647/psycopg2-2.8.5.tar.gz
ERROR: Command errored out with exit status 1:
command: /Users/applecare/PycharmProjects/learning_log/11_env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/w6/sqx_mjh176x08sjppl82f1l80000gn/T/pip-install-8j8wbzsu/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/w6/sqx_mjh176x08sjppl82f1l80000gn/T/pip-install-8j8wbzsu/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/w6/sqx_mjh176x08sjppl82f1l80000gn/T/pip-install-8j8wbzsu/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
<https://www.psycopg.org/docs/install.html>).
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 20.2.2 is available.
You should consider upgrading via the '`pip install --upgrade pip`' command.
If you are on Linux, you will need to install PostgreSQL to run your database and then to connect the clients to your PostgreSQL database you will need other packages like libpq-dev, libpq5.
You can install the above packages with the below commands.
sudo apt-get install postgresql
sudo apt-get install libpq5
sudo apt-get install libpq-dev
So if you’re on Mac, I can think of two ways:
pip install psycopg2-binary
Install PostgreSQL with brew or the excellent postgre.app and point the path to pg_config binary (this is actually the error you’re getting)
On Mac I did brew install postgresql and it did the trick for me

Install h5py without sudo

I'm trying to install h5py package via pip for python 2.7, I can't use sudo and I have python 3.2 installed too.
Here is my attemp:
I have installed pip:
curl -O https://bootstrap.pypa.io/get-pip.py
python2.7 get-pip.py --user
then I installed wheel
~/.local/bin/pip2.7 install --user wheel
Collecting wheel
/home/myuser/.local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/home/myuser/.local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Using cached wheel-0.29.0-py2.py3-none-any.whl
Installing collected packages: wheel
Successfully installed wheel-0.29.0
Then installed h5py, seems it failed.
~/.local/bin/pip2.7 install --user h5py
Collecting h5py
Using cached h5py-2.5.0.tar.gz
/usr/lib/python2.7/dist-packages/setuptools/command/install_scripts.py:3: UserWarning: Module pip was already imported from /home/myuser/.local/lib/python2.7/site-packages/pip/__init__.pyc, but /usr/lib/python2.7/dist-packages is being added to sys.path
from pkg_resources import Distribution, PathMetadata, ensure_directory
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.6.1 in /usr/lib/python2.7/dist-packages (from h5py)
Requirement already satisfied (use --upgrade to upgrade): Cython>=0.17 in /home/myuser/.local/lib/python2.7/site-packages (from h5py)
Requirement already satisfied (use --upgrade to upgrade): six in /home/myuser/.local/lib/python2.7/site-packages (from h5py)
Building wheels for collected packages: h5py
Running setup.py bdist_wheel for h5py ... error
Complete output from command /usr/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-7KTR1Y/h5py/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpE1KVSupip-wheel- --python-tag cp27:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'bdist_wheel'
----------------------------------------
Failed building wheel for h5py
Running setup.py clean for h5py
Failed to build h5py
Installing collected packages: h5py
Running setup.py install for h5py ... done
Successfully installed h5py-2.5.0
run python via python2.7
Python 2.7.3 (default, Feb 27 2014, 19:58:35)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import h5py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/myuser/.local/lib/python2.7/site-packages/h5py/__init__.py", line 23, in <module>
from . import _conv
File "h5py/h5r.pxd", line 21, in init h5py._conv (/tmp/pip-build-7KTR1Y/h5py/h5py/_conv.c:7356)
File "h5py/_objects.pxd", line 12, in init h5py.h5r (/tmp/pip-build-7KTR1Y/h5py/h5py/h5r.c:2941)
File "h5py/_objects.pyx", line 1, in init h5py._objects (/tmp/pip-build-7KTR1Y/h5py/h5py/_objects.c:7226)
ImportError: /home/myuser/.local/lib/python2.7/site-packages/h5py/defs.so: undefined symbol: H5Oexists_by_name
What I'm doing wrong?
Update:
~/.local/bin/pip2.7 show h5py
---
Metadata-Version: 1.1
Name: h5py
Version: 2.5.0
Summary: Read and write HDF5 files from Python
Home-page: http://www.h5py.org
Author: Andrew Collette
Author-email: andrew dot collette at gmail dot com
License: UNKNOWN
Location: /home/myuser/.local/lib/python2.7/site-packages
Requires: numpy, Cython, six
My OS is Ubuntu 12.04.1 LTS.
So there's a few things happening here:
Missing SSL certificate problems (see the urllib3 link)
setuptools not finding wheel, meaning a wheel isn't built, so pip calls python setup.py install directly
h5py is trying to use a function in HDF5 which does not exist in the version of HDF5 that's on your system.
1 and 2 are worth fixing (as they may be symptoms of other problems with the system), but 3 is the reason h5py isn't working for you.
h5py is trying to access H5Oexists_by_name. According to https://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-ExistsByName, this first appeared in version 1.8.5 of HDF5. According to http://packages.ubuntu.com/source/precise/hdf5, the version of HDF5 on your system is 1.8.4 (but you need to check this!). Somehow h5py thinks the HDF5 library on you system is 1.8.5 or higher (see https://github.com/h5py/h5py/blob/4ee8f89b6dc658fdea5dc62d0f29058121928cfe/h5py/h5o.pyx#L172)
It looks like someone else has run into a similar problem, and filed https://bugs.launchpad.net/ubuntu/+source/hdf5/+bug/1418220. You probably want to inform them of your problem, so that they can produce a bug fix.