Pylint Error - no module named astroid - pylint

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

Related

Airflow Installation issue| setproctitle

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

fatal error C1083: Cannot open include file: 'sys/un.h': No such file or directory

I'm getting these errors while working with Spyder and Anaconda. My Python scripts only work with the Anaconda prompt and nothing else is working. This is the whole error:
_cffi_ext.c
anaconda3\lib\site-packages\zmq\backend\cffi\__pycache__\_cffi_ext.c(266): fatal error C1083: Cannot open include file: 'sys/un.h': No such file or directory
Traceback (most recent call last):
File "C:\Users\harsh_c1pywie\anaconda3\Scripts\spyder-script.py", line 6, in <module>
from spyder.app.start import main
File "C:\Users\harsh_c1pywie\anaconda3\lib\site-packages\spyder\app\start.py", line 22, in <module>
import zmq
File "C:\Users\harsh_c1pywie\anaconda3\lib\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
File "C:\Users\harsh_c1pywie\anaconda3\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "C:\Users\harsh_c1pywie\anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\harsh_c1pywie\anaconda3\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\harsh_c1pywie\anaconda3\lib\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\Users\harsh_c1pywie\anaconda3\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed: The specified module could not be found.
I even uninstalled and installed zmq but the error persists.
Try
pip uninstall pyzmq
pip install pyzmq
#CanciuCostin's answer is correct, but for doing something slightly different worked:
pip uninstall pyzmq
pip install --user pyzmq
HTH.

Problem installing importlib on Mac with pip3

Good morning!
Until yesterday I was using python 2.7 and using the following code for writing output files for my scripts:
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
But now I'm upgrading my code to python 3.7, so now I need to use importlib.reloadinstead of just reload. However, typing sudo -H pip3 install importlib on my shell gives me the following error:
Collecting importlib
Using cached https://files.pythonhosted.org/packages/31/77/3781f65cafe55480b56914def99022a5d2965a4bb269655c89ef2f1de3cd/importlib-1.0.4.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 6, in <module>
import distutils.core
File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 16, in <module>
from distutils.dist import Distribution
File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 19, in <module>
from distutils.util import check_environ, strtobool, rfc822_escape
File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/util.py", line 9, in <module>
import importlib.util
ModuleNotFoundError: No module named 'importlib.util'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-install-3cz_3d6n/importlib/
After looking for solutions I also tried to upgrade setuptools, but that didn't fix my problem.
Many thanks in advance!
importlib at PyPI is an outdated package intended for very old Python versions. For new versions of Python importlib is a module from the standard library, you don't need to install it, it's always available.

after install ElastAlert, not running

im install elastalert plugin to kibana,
and downloaded clone github ElastAlert,
and config basic file Config.Yaml
but not running
this error:
root#l-elk1:~# python elastalert/elastalert/elastalert.py
Traceback (most recent call last):
File "elastalert/elastalert/elastalert.py", line 19, in <module>
import kibana
File "/home/ituser/elastalert/elastalert/kibana.py", line 5, in <module>
from util import EAException
File "/home/ituser/elastalert/elastalert/util.py", line 8, in <module>
from auth import Auth
File "/home/ituser/elastalert/elastalert/auth.py", line 4, in <module>
from aws_requests_auth.aws_auth import AWSRequestsAuth
ImportError: No module named aws_requests_auth.aws_auth
This error show a missing requirement dependency. Inside your checkout run the command:
pip install -r requirements.txt
And then re execute elastalert.

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

Resources