Sudden failure on pip install of awsebcli NameError: name 'platform_system' is not defined - pip

I have a Node app that's deployed via Shippable. A few weeks ago my builds started failing without any environmental changes (10/15/19 was last successful build)
I'm deploying to Node v 6.11.5, and it's failing on awsebcli install
The CI/CD pipeline requires AWS Elastic Beanstalk CLI and back when I set this up a while ago I figured we need a specific version below to make everything work with this Node version and all
pip install --force-reinstall awsebcli==3.14.5 is the line that fails, with the error
NameError: name 'platform_system' is not defined
I guess I'm hopeful that I just need to target a different version of awsebcli but I can't seem to figure out what to do
and the full error logs...
Downloading/unpacking docker-compose>=1.21.2,<1.22.0 (from awsebcli==3.14.5)
Downloading/unpacking blessed>=1.9.5 (from awsebcli==3.14.5)
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1266, in prepare_files
req_to_install.extras):
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2291, in requires
dm = self._dep_map
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2484, in _dep_map
self.__dep_map = self._compute_dependencies()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2517, in _compute_dependencies
common = frozenset(reqs_for_extra(None))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2514, in reqs_for_extra
if req.marker_fn(override={'extra':extra}):
File "/usr/share/python-wheels/setuptools-3.3-py2.py3-none-any.whl/_markerlib/markers.py", line 113, in marker_fn
return eval(compiled_marker, environment)
File "<environment marker>", line 1, in <module>
NameError: name 'platform_system' is not defined

setuptools-3.3 was released in 2014! Must be upgraded for sure:
pip install --upgrade setuptools

Related

Airflow on WSL2 Ubuntu: ValueError: Unable to configure handler 'processor'

I am aware that very similar questions have been asked previously but I have found these have tended to include Docker, which I am not using at this time, nor do I have installed. I am led to believe that WSL2 should be an alternative to Docker regarding running Airflow on Windows.
I am using WSL2 on my Windows 11 laptop and have installed Apache-Airflow from a tutorial from the following link:
https://coding-stream-of-consciousness.com/2018/11/06/apache-airflow-windows-10-install-ubuntu/
On WSL2 I have:
Python version 3.8.10
Pip version 20.0.2
Apache-Airflow 2.4.1 (I believe)
I have run the following commands (as per the tutorial) with no issue:
sudo apt-get install software-properties-common
sudo apt-add-repository universe
sudo apt-get update
sudo apt-get install python-pip
sudo pip install apache-airflow #I had path issues without 'sudo' command
But when I attempt to use the 'airflow' command in the WSL2 Ubuntu terminal, I am greeted with the following error:
$ airflow
Unable to load the config, contains a configuration error.
Traceback (most recent call last):
File "/usr/lib/python3.8/logging/config.py", line 563, in configure
handler = self.configure_handler(handlers[name])
File "/usr/lib/python3.8/logging/config.py", line 744, in configure_handler
result = factory(**kwargs)
File "/usr/local/lib/python3.8/dist-packages/airflow/utils/log/file_processor_handler.py", line 45, in __init__
self.filename_template, self.filename_jinja_template = parse_template_string(filename_template)
File "/usr/local/lib/python3.8/dist-packages/airflow/utils/helpers.py", line 165, in parse_template_string
import jinja2
File "/usr/lib/python3/dist-packages/jinja2/__init__.py", line 33, in <module>
from jinja2.environment import Environment, Template
File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 15, in <module>
from jinja2 import nodes
File "/usr/lib/python3/dist-packages/jinja2/nodes.py", line 23, in <module>
from jinja2.utils import Markup
File "/usr/lib/python3/dist-packages/jinja2/utils.py", line 656, in <module>
from markupsafe import Markup, escape, soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/lib/python3.8/dist-packages/markupsafe/__init__.py)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/airflow", line 5, in <module>
from airflow.__main__ import main
File "/usr/local/lib/python3.8/dist-packages/airflow/__init__.py", line 46, in <module>
settings.initialize()
File "/usr/local/lib/python3.8/dist-packages/airflow/settings.py", line 564, in initialize
LOGGING_CLASS_PATH = configure_logging()
File "/usr/local/lib/python3.8/dist-packages/airflow/logging_config.py", line 74, in configure_logging
raise e
File "/usr/local/lib/python3.8/dist-packages/airflow/logging_config.py", line 69, in configure_logging
dictConfig(logging_config)
File "/usr/lib/python3.8/logging/config.py", line 808, in dictConfig
dictConfigClass(config).configure()
File "/usr/lib/python3.8/logging/config.py", line 570, in configure
raise ValueError('Unable to configure handler '
ValueError: Unable to configure handler 'processor'
I have googled the ValueError extensively and can't find any clear solutions that don't involve Docker.
Any insight into the error would be much appreciated!
You should install airflow using constraints.
https://airflow.apache.org/docs/apache-airflow/stable/installation/installing-from-pypi.html#installation-tools
This is the only way installation of airflow is guaranteed to work.

Heroku deployment failed of missing mariadb-config or MariaDB connector from remote DB

Wanted to make run my Python Flask project via Heroku (it's the first time I am using it). The case is, that I connect to a remote MariaDB on a Ubuntu VM.
When I try to push from local git I get an error to be related to the MariaDB. Is there an idea how I can solve this problem?
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [19 lines of output]
/bin/sh: 1: mariadb_config: not found
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-2j753bw3/mariadb_0c456c224d01457ab040c19f32e1f9ee/setup.py", line 26, in <module>
cfg = get_config(options)
File "/tmp/pip-install-2j753bw3/mariadb_0c456c224d01457ab040c19f32e1f9ee/mariadb_posix.py", line 63, in get_config
cc_version = mariadb_config(config_prg, "cc_version")
File "/tmp/pip-install-2j753bw3/mariadb_0c456c224d01457ab040c19f32e1f9ee/mariadb_posix.py", line 28, in mariadb_config
raise EnvironmentError(
OSError: mariadb_config not found.
This error typically indicates that MariaDB Connector/C, a dependency which must be preinstalled,
is not found.
If MariaDB Connector/C is not installed, see installation instructions
at: https://github.com/mariadb-corporation/mariadb-connector-c/wiki/install.md.
If MariaDB Connector/C is installed, either set the environment variable MARIADB_CONFIG or edit
the configuration file 'site.cfg' to set the 'mariadb_config' option to the file location of the
mariadb_config utility.
[end of output]
It looks like you need the mariadb_config utility at compile time. This is likely because whatever Python driver you are using requires it.
mariadb_config is available in the libmariadb-dev Ubuntu package. You'll need to install that using the Apt buildpack.
Add the buildpack:
heroku buildpacks:add --index 1 heroku-community/apt
That buildpack doesn't do dependency resolution, so you'll have to list all transitive dependencies.
Create a new file called Aptfile (no extension) that lists the dependencies you wish to install:
mysql-common
mariadb-common
libmariadb3
libmariadb-dev
Commit your Aptfile and redeploy.

Conda info (and other operations) not working

I am trying to install geopandas and have therefore downloaded anaconda. However the anaconda prompt gives back an error when I try the command "conda install geopandas" (Installing geopandas with anaconda prompt causes ImportError). I discovered that conda won't install any package, nor will it create new environments. And, as it happens, will not even work for "conda info" (see below error report).
Looking through help suggestions on the internet I added both "C:\Users\Name\anaconda3" and "C:\Users\Name\anaconda3\Scripts" to the PATH System environment variable but it didn't resolve the issue.
Any help would be greatly appreciated.
>>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
Traceback (most recent call last):
File "C:\Users\Francesco\anaconda3\lib\site-packages\conda\exceptions.py", line 1079, in __call__
return func(*args, **kwargs)
File "C:\Users\Francesco\anaconda3\lib\site-packages\conda\cli\main.py", line 84, in _main
exit_code = do_call(args, p)
File "C:\Users\Francesco\anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 83, in do_call
return getattr(module, func_name)(args, parser)
File "C:\Users\Francesco\anaconda3\lib\site-packages\conda\cli\main_info.py", line 316, in execute
info_dict = get_info_dict(args.system)
File "C:\Users\Francesco\anaconda3\lib\site-packages\conda\cli\main_info.py", line 164, in get_info_dict
pkgs_dirs=context.pkgs_dirs,
File "C:\Users\Francesco\anaconda3\lib\site-packages\conda\base\context.py", line 520, in pkgs_dirs
fixed_dirs += user_data_dir(APP_NAME, APP_NAME),
File "C:\Users\Francesco\anaconda3\lib\site-packages\conda\_vendor\appdirs.py", line 67, in user_data_dir
path = os.path.join(_get_win_folder(const), appauthor, appname)
File "C:\Users\Francesco\anaconda3\lib\site-packages\conda\_vendor\appdirs.py", line 284, in _get_win_folder_with_pywin32
from win32com.shell import shellcon, shell
ImportError: DLL load failed while importing shell: The specified module could not be found.
$ C:\Users\Francesco\anaconda3\Scripts\conda-script.py info
'''
I've experienced pretty much the same problem. I was able to narrow down the issue to pywin32 version 302.
Using version 301 worked for me.
Try: pip install pywin32==301 --force
See https://github.com/mhammond/pywin32/issues/1783

Getting error when trying to install apache-airflow on Mac. How can I fix this?

Error output below:
ronakvora:dtc ronakvora$ pip install apache-airflow
Installing build dependencies ... done
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/pendulum.egg-info
writing requirements to pip-egg-info/pendulum.egg-info/requires.txt
writing pip-egg-info/pendulum.egg-info/PKG-INFO
writing top-level names to pip-egg-info/pendulum.egg-info/top_level.txt
writing dependency_links to pip-egg-info/pendulum.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/pendulum.egg-info/SOURCES.txt'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/6x/xsb52c7936l38mmb9f7s268m0000gn/T/pip-install-WFGcOd/pendulum/setup.py", line 50, in <module>
setup(**setup_kwargs)
File "/usr/local/Cellar/python#2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/local/Cellar/python#2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/local/Cellar/python#2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/private/var/folders/6x/xsb52c7936l38mmb9f7s268m0000gn/T/pip-build-env-HZt1xp/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 296, in run
self.find_sources()
File "/private/var/folders/6x/xsb52c7936l38mmb9f7s268m0000gn/T/pip-build-env-HZt1xp/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 303, in find_sources
mm.run()
File "/private/var/folders/6x/xsb52c7936l38mmb9f7s268m0000gn/T/pip-build-env-HZt1xp/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 534, in run
self.add_defaults()
File "/private/var/folders/6x/xsb52c7936l38mmb9f7s268m0000gn/T/pip-build-env-HZt1xp/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 570, in add_defaults
sdist.add_defaults(self)
File "/private/var/folders/6x/xsb52c7936l38mmb9f7s268m0000gn/T/pip-build-env-HZt1xp/lib/python2.7/site-packages/setuptools/command/py36compat.py", line 36, in add_defaults
self._add_defaults_ext()
File "/private/var/folders/6x/xsb52c7936l38mmb9f7s268m0000gn/T/pip-build-env-HZt1xp/lib/python2.7/site-packages/setuptools/command/py36compat.py", line 119, in _add_defaults_ext
build_ext = self.get_finalized_command('build_ext')
File "/usr/local/Cellar/python#2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command
cmd_obj.ensure_finalized()
File "/usr/local/Cellar/python#2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/usr/local/Cellar/python#2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_ext.py", line 159, in finalize_options
self.include_dirs.append(py_include)
AttributeError: 'unicode' object has no attribute 'append'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/6x/xsb52c7936l38mmb9f7s268m0000gn/T/pip-install-WFGcOd/pendulum/
You are using pip version 18.1, however version 19.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
I had recently encountered a similar error on Airflow 1.10.2 and in my case it was related to incorrect version of pendulum
Run pip show pendulum
Name: pendulum
Version: 1.4.4
Summary: Python datetimes made easy.
...
If your version of pendulum is different from v1.4.4 just do a force-reinstall (Airflow 1.10.2 requires pendulum===1.4.4)
pip install --force-reinstall pendulum===1.4.4
References
Find which version of package is installed with pip
Installing specific package versions with pip
I didn't exactly solve the issue above, but just decided to switch to python3 and used pip3 install apache-airflow.

F5 integration on ansible

Until now, I used the core module of Ansible.
Now I would play also with Extra Module. Let's say that I want to use on my playbook: bigip_partition.
I've seen that it is in https://github.com/F5Networks/f5-ansible/tree/master/library
Could someone tell me how to install them?
I'm on Ubuntu 14LTS, Ansible 2.2
At the moment:
> sudo pip install bigsuds --upgrade pip
> sudo pip install f5-sdk
> sudo pip install git+https://github.com/F5Networks/f5-ansible.git -vvv
Collecting git+https://github.com/F5Networks/f5-ansible.git
Cloning https://github.com/F5Networks/f5-ansible.git to /tmp/pip-NjrWJw-build
Running command git clone -q https://github.com/F5Networks/f5-ansible.git /tmp/pip-NjrWJw-build
Running setup.py (path:/tmp/pip-NjrWJw-build/setup.py) egg_info for package from git+https://github.com/F5Networks/f5-ansible.git
Running command python setup.py egg_info
Traceback (most recent call last):
File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: '/tmp/pip-NjrWJw-build/setup.py'
Cleaning up...
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-NjrWJw-build/
Exception information:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 634, in _prepare_file
abstract_dist.prep_for_dist()
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 129, in prep_for_dist
self.req_to_install.run_egg_info()
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 439, in run_egg_info
command_desc='python setup.py egg_info')
File "/usr/local/lib/python2.7/dist-packages/pip/utils/__init__.py", line 707, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-NjrWJw-build/
Thanks,
Riccardo
https://github.com/F5Networks/f5-ansible is not a python package, don't try to install it with pip.
To use those modules you just need to put py-files from library to your playbook-path/library.
You'll have a much better experience if you install the 'App Services 3.0' (AS3) declarative interface on you BIG-IP:
https://clouddocs.f5.com/products/extensions/f5-appsvcs-extension/3/
Then you just send 'declarations' of your desired state, instead of working with MANY imperative interfaces...
Here are some example declarations (which are easy to generate/manipulate in Ansible using Jinja2 templates):
https://clouddocs.f5.com/products/extensions/f5-appsvcs-extension/3/userguide/examples.html

Resources