Airflow Installation issue| setproctitle - installation

I Have followed the below steps for airflow installation and have successfully installed but am unable to run any commands which start with airflow, even to check the version. Any help is appreciated.
python3.9 -m venv airflowenv ,
source airflowenv/bin/activate export ,
AIRFLOW_HOME=~/airflow ,
echo $AIRFLOW_HOME ,
pip install --upgrade pip ,
pip install apache-airflow==1.10.15 ,
airflow initdb.
This is the error am receiving:
Traceback (most recent call last):
File "/Users/user_name/Documents/python_learning/airflow/airflowenv/bin/airflow", line 25, in <module>
from airflow.configuration import conf
File "/Users/user_name/Documents/python_learning/airflow/airflowenv/lib/python3.8/site-packages/airflow/__init__.py", line 50, in <module>
from airflow.models import DAG # noqa: E402
File "/Users/user_name/Documents/python_learning/airflow/airflowenv/lib/python3.8/site-packages/airflow/models/__init__.py", line 21, in <module>
from airflow.models.baseoperator import BaseOperator, BaseOperatorLink # noqa: F401
File "/Users/user_name/Documents/python_learning/airflow/airflowenv/lib/python3.8/site-packages/airflow/models/baseoperator.py", line 43, in <module>
from airflow.models.dag import DAG
File "/Users/user_name/Documents/python_learning/airflow/airflowenv/lib/python3.8/site-packages/airflow/models/dag.py", line 47, in <module>
from airflow.executors import LocalExecutor, get_default_executor
File "/Users/user_name/Documents/python_learning/airflow/airflowenv/lib/python3.8/site-packages/airflow/executors/__init__.py", line 23, in <module>
from airflow.executors.base_executor import BaseExecutor # noqa
File "/Users/user_name/Documents/python_learning/airflow/airflowenv/lib/python3.8/site-packages/airflow/executors/base_executor.py", line 24, in <module>
import airflow.utils.dag_processing
File "/Users/user_name/Documents/python_learning/airflow/airflowenv/lib/python3.8/site-packages/airflow/utils/dag_processing.py", line 40, in <module>
from setproctitle import setproctitle
ImportError: dlopen(/Users/user_name/Documents/python_learning/airflow/airflowenv/lib/python3.8/site-packages/setproctitle.cpython-38-darwin.so, 2): Symbol not found: _Py_GetArgcArgv
Referenced from: /Users/user_name/Documents/python_learning/airflow/airflowenv/lib/python3.8/site-packages/setproctitle.cpython-38-darwin.so
Expected in: flat namespace
in /Users/user_name/Documents/python_learning/airflow/airflowenv/lib/python3.8/site-packages/setproctitle.cpython-38-darwin.so```
---------------------------------------------------------------------*********************************************************************
SOLUTION:[Followed these steps to fix the issue]:
Install python3.9 from the python website
python3.9 -m venv envpython
source envpython/bin/activate
export AIRFLOW_HOME=~/airflow
echo $AIRFLOW_HOME
pip install apache-airflow==1.10.15 --constraint https://raw.githubusercontent.com/apache/airflow/constraints-1.10.15/constraints-3.8.txt
airflow initdb
airflow webserver
airflow scheduler
*********************************************************************

If you are on MacOS, you need to install Python 3.8 manually following https://www.python.org/downloads/.
See Import issue for setproctitle on Mac OS,

You should use constraints when installing Airflow. See this link that explains why: https://airflow.apache.org/docs/apache-airflow/stable/installation.html#constraints-files
In your case, the correct command will be:
pip install apache-airflow==1.10.15 --constraint https://raw.githubusercontent.com/apache/airflow/constraints-1.10.15/constraints-3.8.txt

Related

ImportError with python-pptx

I faced with problem when I installed python-pptx with conda on cleaned environment:
conda install -c conda-forge python-pptx. After install was successfully finished I tried to import pptx module and got following error:
>>> import pptx
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\SazonovEO\AppData\Local\Continuum\anaconda3\envs\new\lib\site-p
ackages\pptx\__init__.py", line 13, in <module>
from pptx.api import Presentation # noqa
File "C:\Users\SazonovEO\AppData\Local\Continuum\anaconda3\envs\new\lib\site-p
ackages\pptx\api.py", line 17, in <module>
from .package import Package
File "C:\Users\SazonovEO\AppData\Local\Continuum\anaconda3\envs\new\lib\site-p
ackages\pptx\package.py", line 13, in <module>
from .opc.package import OpcPackage
File "C:\Users\SazonovEO\AppData\Local\Continuum\anaconda3\envs\new\lib\site-p
ackages\pptx\opc\package.py", line 13, in <module>
from .oxml import CT_Relationships, serialize_part_xml
File "C:\Users\SazonovEO\AppData\Local\Continuum\anaconda3\envs\new\lib\site-p
ackages\pptx\opc\oxml.py", line 12, in <module>
from lxml import etree
ImportError: DLL load failed: Не найден указанный модуль.
But if I installed this library (python-pptx) with pip like this (also into new cleaned environment):
pip install python-pptx
this works.
I have following versions: python version - 3.7.1, python-pptx-0.6.17, lxml-4.3.0.
Do you have any ideas about this issue?
Reinstallation lxml from pkgs/main channel from anaconda repo allow workaround issue:
conda install lxml
The following packages will be UPDATED:
libxml2 conda-forge::libxml2-2.9.8-h9ce36c8_1~ -->
pkgs/main::libxm l2-2.9.9-h464c3ec_0 libxslt
conda-forge::libxslt-1.1.32-heafd4d3_~ --> pkgs/main::libxs
lt-1.1.33-h579f668_0
The following packages will be SUPERSEDED by a higher-priority
channel: ... lxml
conda-forge::lxml-4.3.2-py37heafd4d3_0 --> pkgs/main::lxml-
4.3.2-py37h1350720_0 ...
First of all, try the following command in your terminal in order to enable the conda-forge:
conda config --add channels conda-forge
Secondly, run the following command and after a while enter [y]:
conda install python-pptx

ImportError: No module named 'thinc.about'

I am trying to install spacy for windows, python 3.x.
I ran the following commands:-
conda install -c conda-forge spacy
python -m spacy download en
"python -m spacy download en" gives the error:-
Traceback (most recent call last):
File "D:\Anaconda3\lib\runpy.py", line 174, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "D:\Anaconda3\lib\runpy.py", line 133, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "D:\Anaconda3\lib\runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "D:\Anaconda3\lib\site-packages\spacy\__init__.py", line 4, in <module>
from .cli.info import info as cli_info
File "D:\Anaconda3\lib\site-packages\spacy\cli\__init__.py", line 1, in <module>
from .download import download
File "D:\Anaconda3\lib\site-packages\spacy\cli\download.py", line 10, in <module>
from .link import link
File "D:\Anaconda3\lib\site-packages\spacy\cli\link.py", line 7, in <module>
from ..compat import symlink_to, path2str
File "D:\Anaconda3\lib\site-packages\spacy\compat.py", line 11, in <module>
from thinc.neural.util import copy_array
File "D:\Anaconda3\lib\site-packages\thinc\__init__.py", line 1, in <module>
from .about import *
ImportError: No module named 'thinc.about'
and the same error when I try to import spacy thereafter. What should I do to successfully install spacy?
I found this link from where I downloaded all of the required whls one by one to install spacy.
Compiling wheel rather than downloading ready one might be helpful as well:
python -m pip install thinc --no-binary=:all:
or
pip install thinc --no-binary=:all:
Don't forget to add --force option if you already have the package.
More information about --no-binary option:
https://pip.pypa.io/en/latest/cli/pip_install/#cmdoption-no-binary

Keras installed but not working

I am using keras with theano as the back end to build a neural network on windows 10. My python version is 2.7. The problem is that when I try and use keras I keep getting a path error.
$python
>>import keras
Gives me the error
Problem occurred during compilation with the command line below:
"g++" -shared -g -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64 -I"C:\Python27\lib\site-packages\numpy\core\include" -I"C:\Python27\include" -I"C:\Python27\lib\site-packages\theano-0.9.0-py2.7.egg\theano\gof" -L"C:\Python27\libs" -L"C:\Python27" -o C:\Users\Patrick\AppData\Local\Theano\compiledir_Windows-10-10.0.14393-Intel64_Family_6_Model_61_Stepping_4_GenuineIntel-2.7.11-64\lazylinker_ext\lazylinker_ext.pyd C:\Users\Patrick\AppData\Local\Theano\compiledir_Windows-10-10.0.14393-Intel64_Family_6_Model_61_Stepping_4_GenuineIntel-2.7.11-64\lazylinker_ext\mod.cpp -lpython27
The system cannot find the path specified.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\keras-2.0.3-py2.7.egg\keras\__init__.py", line 3, in <module>
from . import activations
File "C:\Python27\lib\site-packages\keras-2.0.3-py2.7.egg\keras\activations.py", line 4, in <module>
from . import backend as K
File "C:\Python27\lib\site-packages\keras-2.0.3-py2.7.egg\keras\backend\__init__.py", line 70, in <module>
from .theano_backend import *
File "C:\Python27\lib\site-packages\keras-2.0.3-py2.7.egg\keras\backend\theano_backend.py", line 3, in <module>
import theano
File "C:\Python27\lib\site-packages\theano-0.9.0-py2.7.egg\theano\__init__.py", line 66, in <module>
from theano.compile import (
File "C:\Python27\lib\site-packages\theano-0.9.0-py2.7.egg\theano\compile\__init__.py", line 10, in <module>
from theano.compile.function_module import *
File "C:\Python27\lib\site-packages\theano-0.9.0-py2.7.egg\theano\compile\function_module.py", line 21, in <module>
import theano.compile.mode
File "C:\Python27\lib\site-packages\theano-0.9.0-py2.7.egg\theano\compile\mode.py", line 10, in <module>
import theano.gof.vm
File "C:\Python27\lib\site-packages\theano-0.9.0-py2.7.egg\theano\gof\vm.py", line 662, in <module>
from . import lazylinker_c
File "C:\Python27\lib\site-packages\theano-0.9.0-py2.7.egg\theano\gof\lazylinker_c.py", line 127, in <module>
preargs=args)
File "C:\Python27\lib\site-packages\theano-0.9.0-py2.7.egg\theano\gof\cmodule.py", line 2316, in compile_str
(status, compile_stderr.replace('\n', '. ')))
. ception: Compilation failed (return status=1): The system cannot find the path specified.
>>>
I can tell that I need to add to my system variables paths (at least I think so...) but no matter what I add I still get the error. I have tried adding
C:\Python27\lib
C:\Python27\lib\site-packages
Basically any of the paths it said could not be specified. Something to note would be that I had a lot of trouble getting scipy installed and had to get the .whl file from http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy not sure if that helps at all. Well that's my issue.
I was also facing the same issue and resolved with removing other python versions. Make sure that you have only 1 python installed. If there is multiple, thing sometimes don't work very well.
What i would suggest is use keras in a separate environment using conda.
Suppose you want to create an env named "myenv"
1.Open Anaconda promt and type the following:
conda create --name myenv
2.To activate the environment:
conda activate myenv
3.Now you can install keras and other dependencies:
pip install keras
Install tensorflow as follows.
pip install tensorflow==2.0.0

Pylint Error - no module named astroid

I've recently installed pylint on a windows 7 and when I run it I get the error:
Error executing PyLint: Command failed with error=None, status=1; stderr:
Traceback (most recent call last):
File "C:\Python27\Scripts\pylint", line 3, in <module>
run_pylint()
File "c:\python27\lib\site-packages\pylint\__init__.py", line 20, in run_pylint
from pylint.lint import Run
File "c:\python27\lib\site-packages\pylint\lint.py", line 30, in <module>
from pylint.checkers import utils #pylint: disable=unused-import
File "c:\python27\lib\site-packages\pylint\checkers__init__.py", line 47, in
from pylint.reporters import diff_string
File "c:\python27\lib\site-packages\pylint\reporters__init__.py", line 20, in
from pylint.utils import MSG_TYPES
File "c:\python27\lib\site-packages\pylint\utils.py", line 32, in
from astroid import nodes, Module
ImportError: No module named astroid
I've followed the install instructions as best I can but can't seem to get past this.
Use this link to install pip properly How do I install pip on Windows?
then do the pip install pylint
then do go through this note http://docs.pylint.org/installation.html#note-for-windows-users

issue with python 3.4+ and pip

I installed pip 3.4 recently , however i cant seem to use pip properly ( which is included with the latest python 3) it gives me this error whenever i attempt to import it :
"Traceback (most recent call last)
File "<pyshell#8>", line 1, in <module>
import pip
File "C:\Python34\lib\site-packages\pip\__ini... line 9, in <module>
from pip.log import logger
File "C:\Python34\lib\site-packages\pip\log.p... line 8, in <module>
from pip import backwardcompat
File "C:\Python34\lib\site-packages\pip\backw... line 27, in <module>
console_encoding = sys.__stdout__.encoding
AttributeError: 'NoneType' object has no attribute 'encoding"``
If you are using python under WIN OS, pip works as a WIN command: try to directly type "pip install .package." in your cmd shell.

Resources