I am trying to make a AI chatbot using python. This requires tensorflow. I installed it using pip and when I try to import it, it isn't working. I got this Traceback:
Installation
C:\Users\vross>pip3 install tensorflow
Requirement already satisfied: tensorflow in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (2.1.0)
Requirement already satisfied: astor>=0.6.0 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorflow) (0.8.1)
Requirement already satisfied: wrapt>=1.11.1 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorflow) (1.12.0)
Requirement already satisfied: gast==0.2.2 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorflow) (0.2.2)
Requirement already satisfied: grpcio>=1.8.6 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorflow) (1.27.2)
Requirement already satisfied: wheel>=0.26; python_version >= "3" in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorflow) (0.34.2)
Requirement already satisfied: scipy==1.4.1; python_version >= "3" in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorflow) (1.4.1)
Requirement already satisfied: google-pasta>=0.1.6 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorflow) (0.1.8)
Requirement already satisfied: keras-preprocessing>=1.1.0 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorflow) (1.1.0)
Requirement already satisfied: opt-einsum>=2.3.2 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorflow) (3.1.0)
Requirement already satisfied: tensorflow-estimator<2.2.0,>=2.1.0rc0 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorflow) (2.1.0)
Requirement already satisfied: six>=1.12.0 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorflow) (1.14.0)
Requirement already satisfied: keras-applications>=1.0.8 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorflow) (1.0.8)
Requirement already satisfied: numpy<2.0,>=1.16.0 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorflow) (1.18.1)
Requirement already satisfied: tensorboard<2.2.0,>=2.1.0 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorflow) (2.1.0)
Requirement already satisfied: termcolor>=1.1.0 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorflow) (1.1.0)
Requirement already satisfied: protobuf>=3.8.0 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorflow) (3.11.3)
Requirement already satisfied: absl-py>=0.7.0 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorflow) (0.9.0)
Requirement already satisfied: h5py in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from keras-applications>=1.0.8->tensorflow) (2.10.0)
Requirement already satisfied: requests<3,>=2.21.0 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow) (2.23.0)
Requirement already satisfied: werkzeug>=0.11.15 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow) (1.0.0)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow) (0.4.1)
Requirement already satisfied: markdown>=2.6.8 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow) (3.2.1)
Requirement already satisfied: setuptools>=41.0.0 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow) (45.2.0)
Requirement already satisfied: google-auth<2,>=1.6.3 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow) (1.11.2)
Requirement already satisfied: chardet<4,>=3.0.2 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow) (3.0.4)
Requirement already satisfied: idna<3,>=2.5 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow) (2.9)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow) (2019.11.28)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow) (1.25.8)
Requirement already satisfied: requests-oauthlib>=0.7.0 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.2.0,>=2.1.0->tensorflow) (1.3.0)
Requirement already satisfied: rsa<4.1,>=3.1.4 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow) (4.0)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow) (4.0.0)
Requirement already satisfied: pyasn1-modules>=0.2.1 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow) (0.2.8)
Requirement already satisfied: oauthlib>=3.0.0 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.2.0,>=2.1.0->tensorflow) (3.1.0)
Requirement already satisfied: pyasn1>=0.1.3 in c:\users\vross\appdata\local\programs\python\python36\lib\site-packages (from rsa<4.1,>=3.1.4->google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow) (0.4.8)
Interactive Session
C:\Users\vross>python
Python 3.6.7 (v3.6.7:6ec5cf24b7, Oct 20 2018, 13:35:33) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
File "C:\Users\vross\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\vross\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\vross\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Users\vross\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\vross\AppData\Local\Programs\Python\Python36\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: Kan opgegeven module niet vinden.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\vross\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 101, in <module>
from tensorflow_core import *
File "C:\Users\vross\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_core\__init__.py", line 40, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\vross\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\Users\vross\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\Users\vross\AppData\Local\Programs\Python\Python36\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\vross\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\vross\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\vross\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\vross\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\vross\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Users\vross\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\vross\AppData\Local\Programs\Python\Python36\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: Kan opgegeven module niet vinden.
Please follow the instructions from TensorFlow website. I recommend install Tensorflow 2, if you are using lower versions.
You need to download and install/update the Microsoft Visual C++ 2015-2019 Redistributable (x64) from here.
If you are facing any other issues possible reasons are
Your CPU does not support AVX2 instructions
Your CPU/Python is on 32 bits
There is a library that is in a different location/not installed on your system that cannot be loaded.
Please refer tested build configurations for windows CPU and GPU.
Related
I am new to Python and pretty much every other programming language. I have extremely simple code,
import streamlit as st
st.title("My To-Do App")
but when I try to run it using
C:\Users\Sanja\Documents\app1>streamlit run C:\Users\Sanja\Documents\app1\main.py
I have this error
(venv) C:\Users\Sanja\Documents\app1>streamlit run C:\Users\Sanja\Documents\app1\main.py
Traceback (most recent call last):
File "C:\Users\Sanja\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Sanja\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\Sanja\Documents\app1\venv\Scripts\streamlit.exe\__main__.py", line 4, in <module>
File "C:\Users\Sanja\Documents\app1\venv\lib\site-packages\streamlit\web\cli.py", line 25, in <module>
import streamlit.web.bootstrap as bootstrap
File "C:\Users\Sanja\Documents\app1\venv\lib\site-packages\streamlit\web\bootstrap.py", line 31, in <module>
from streamlit.web.server import Server, server_address_is_unix_socket, server_util
File "C:\Users\Sanja\Documents\app1\venv\lib\site-packages\streamlit\web\server\__init__.py", line 15, in <module>
from streamlit.web.server.component_request_handler import ComponentRequestHandler
File "C:\Users\Sanja\Documents\app1\venv\lib\site-packages\streamlit\web\server\component_request_handler.py", line 18, in <module>
import tornado.web
File "C:\Users\Sanja\Documents\app1\venv\lib\site-packages\tornado\web.py", line 91, in <module>
from tornado.httpserver import HTTPServer
File "C:\Users\Sanja\Documents\app1\venv\lib\site-packages\tornado\httpserver.py", line 32, in <module>
from tornado.http1connection import HTTP1ServerConnection, HTTP1ConnectionParameters
File "C:\Users\Sanja\Documents\app1\venv\lib\site-packages\tornado\http1connection.py", line 34, in <module>
from tornado import iostream
File "C:\Users\Sanja\Documents\app1\venv\lib\site-packages\tornado\iostream.py", line 40, in <module>
from tornado.netutil import ssl_wrap_socket, _client_ssl_defaults, _server_ssl_defaults
File "C:\Users\Sanja\Documents\app1\venv\lib\site-packages\tornado\netutil.py", line 35, in <module>
_client_ssl_defaults = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
File "C:\Users\Sanja\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 771, in create_default_context
context.load_default_certs(purpose)
File "C:\Users\Sanja\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 592, in load_default_certs
self._load_windows_store_certs(storename, purpose)
File "C:\Users\Sanja\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 584, in _load_windows_store_certs
self.load_verify_locations(cadata=certs)
ssl.SSLError: not enough data: cadata does not contain a certificate (_ssl.c:3989)
(venv) C:\Users\Sanja\Documents\app1>pip install streamlit==1.14.0
Collecting streamlit==1.14.0
Downloading streamlit-1.14.0-py2.py3-none-any.whl (9.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.2/9.2 MB 9.9 MB/s eta 0:00:00
Requirement already satisfied: toml in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (0.10.2)
Requirement already satisfied: validators>=0.2 in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (0.20.0)
Requirement already satisfied: blinker>=1.0.0 in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (1.5)
Requirement already satisfied: pillow>=6.2.0 in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (9.4.0)
Requirement already satisfied: requests>=2.4 in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (2.28.2)
Requirement already satisfied: pyarrow>=4.0 in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (10.0.1)
Requirement already satisfied: pympler>=0.9 in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (1.0.1)
Requirement already satisfied: protobuf<4,>=3.12 in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (3.20.1)
Requirement already satisfied: pandas>=0.21.0 in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (1.5.3)
Requirement already satisfied: typing-extensions>=3.10.0.0 in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (4.4.0)
Requirement already satisfied: cachetools>=4.0 in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (5.3.0)
Requirement already satisfied: tzlocal>=1.1 in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (4.2)
Requirement already satisfied: pydeck>=0.1.dev5 in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (0.8.0)
Requirement already satisfied: altair>=3.2.0 in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (4.2.0)
Requirement already satisfied: click>=7.0 in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (8.1.3)
Requirement already satisfied: importlib-metadata>=1.4 in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (6.0.0)
Requirement already satisfied: watchdog in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (2.2.1)
Requirement already satisfied: python-dateutil in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (2.8.2)
Requirement already satisfied: tornado>=5.0 in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (6.2)
Requirement already satisfied: semver in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (2.13.0)
Requirement already satisfied: rich>=10.11.0 in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (13.2.0)
Requirement already satisfied: gitpython!=3.1.19 in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (3.1.30)
Requirement already satisfied: numpy in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (1.24.1)
Requirement already satisfied: packaging>=14.1 in c:\users\sanja\documents\app1\venv\lib\site-packages (from streamlit==1.14.0) (23.0)
Requirement already satisfied: jinja2 in c:\users\sanja\documents\app1\venv\lib\site-packages (from altair>=3.2.0->streamlit==1.14.0) (3.1.2)
Requirement already satisfied: toolz in c:\users\sanja\documents\app1\venv\lib\site-packages (from altair>=3.2.0->streamlit==1.14.0) (0.12.0)
Requirement already satisfied: entrypoints in c:\users\sanja\documents\app1\venv\lib\site-packages (from altair>=3.2.0->streamlit==1.14.0) (0.4)
Requirement already satisfied: jsonschema>=3.0 in c:\users\sanja\documents\app1\venv\lib\site-packages (from altair>=3.2.0->streamlit==1.14.0) (4.17.3)
Requirement already satisfied: colorama in c:\users\sanja\documents\app1\venv\lib\site-packages (from click>=7.0->streamlit==1.14.0) (0.4.6)
Requirement already satisfied: gitdb<5,>=4.0.1 in c:\users\sanja\documents\app1\venv\lib\site-packages (from gitpython!=3.1.19->streamlit==1.14.0) (4.0.10)
Requirement already satisfied: zipp>=0.5 in c:\users\sanja\documents\app1\venv\lib\site-packages (from importlib-metadata>=1.4->streamlit==1.14.0) (3.11.0)
Requirement already satisfied: pytz>=2020.1 in c:\users\sanja\documents\app1\venv\lib\site-packages (from pandas>=0.21.0->streamlit==1.14.0) (2022.7.1)
Requirement already satisfied: six>=1.5 in c:\users\sanja\documents\app1\venv\lib\site-packages (from python-dateutil->streamlit==1.14.0) (1.16.0)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\sanja\documents\app1\venv\lib\site-packages (from requests>=2.4->streamlit==1.14.0) (3.0.1)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\sanja\documents\app1\venv\lib\site-packages (from requests>=2.4->streamlit==1.14.0) (2022.12.7)
Requirement already satisfied: idna<4,>=2.5 in c:\users\sanja\documents\app1\venv\lib\site-packages (from requests>=2.4->streamlit==1.14.0) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\sanja\documents\app1\venv\lib\site-packages (from requests>=2.4->streamlit==1.14.0) (1.26.14)
Requirement already satisfied: pygments<3.0.0,>=2.6.0 in c:\users\sanja\documents\app1\venv\lib\site-packages (from rich>=10.11.0->streamlit==1.14.0) (2.14.0)
Requirement already satisfied: markdown-it-py<3.0.0,>=2.1.0 in c:\users\sanja\documents\app1\venv\lib\site-packages (from rich>=10.11.0->streamlit==1.14.0) (2.1.0)
Requirement already satisfied: tzdata in c:\users\sanja\documents\app1\venv\lib\site-packages (from tzlocal>=1.1->streamlit==1.14.0) (2022.7)
Requirement already satisfied: pytz-deprecation-shim in c:\users\sanja\documents\app1\venv\lib\site-packages (from tzlocal>=1.1->streamlit==1.14.0) (0.1.0.post0)
Requirement already satisfied: decorator>=3.4.0 in c:\users\sanja\documents\app1\venv\lib\site-packages (from validators>=0.2->streamlit==1.14.0) (5.1.1)
Requirement already satisfied: smmap<6,>=3.0.1 in c:\users\sanja\documents\app1\venv\lib\site-packages (from gitdb<5,>=4.0.1->gitpython!=3.1.19->streamlit==1.14.0) (5.0.0)
Requirement already satisfied: MarkupSafe>=2.0 in c:\users\sanja\documents\app1\venv\lib\site-packages (from jinja2->altair>=3.2.0->streamlit==1.14.0) (2.1.2)
Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in c:\users\sanja\documents\app1\venv\lib\site-packages (from jsonschema>=3.0->altair>=3.2.0->streamlit==1.
14.0) (0.19.3)
Requirement already satisfied: attrs>=17.4.0 in c:\users\sanja\documents\app1\venv\lib\site-packages (from jsonschema>=3.0->altair>=3.2.0->streamlit==1.14.0) (22.2.0)
Requirement already satisfied: mdurl~=0.1 in c:\users\sanja\documents\app1\venv\lib\site-packages (from markdown-it-py<3.0.0,>=2.1.0->rich>=10.11.0->streamlit==1.14.0) (0.1.2)
Installing collected packages: streamlit
Attempting uninstall: streamlit
Found existing installation: streamlit 1.17.0
Uninstalling streamlit-1.17.0:
Successfully uninstalled streamlit-1.17.0
Successfully installed streamlit-1.14.0
(venv) C:\Users\Sanja\Documents\app1>streamlit run C:\Users\Sanja\Documents\app1\main.py
Traceback (most recent call last):
File "C:\Users\Sanja\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Sanja\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\Sanja\Documents\app1\venv\Scripts\streamlit.exe\__main__.py", line 4, in <module>
File "C:\Users\Sanja\Documents\app1\venv\lib\site-packages\streamlit\web\cli.py", line 24, in <module>
import streamlit.web.bootstrap as bootstrap
File "C:\Users\Sanja\Documents\app1\venv\lib\site-packages\streamlit\web\bootstrap.py", line 31, in <module>
from streamlit.web.server import Server, server_address_is_unix_socket, server_util
File "C:\Users\Sanja\Documents\app1\venv\lib\site-packages\streamlit\web\server\__init__.py", line 15, in <module>
from streamlit.web.server.component_request_handler import ComponentRequestHandler
File "C:\Users\Sanja\Documents\app1\venv\lib\site-packages\streamlit\web\server\component_request_handler.py", line 18, in <module>
import tornado.web
File "C:\Users\Sanja\Documents\app1\venv\lib\site-packages\tornado\web.py", line 91, in <module>
from tornado.httpserver import HTTPServer
File "C:\Users\Sanja\Documents\app1\venv\lib\site-packages\tornado\httpserver.py", line 32, in <module>
from tornado.http1connection import HTTP1ServerConnection, HTTP1ConnectionParameters
File "C:\Users\Sanja\Documents\app1\venv\lib\site-packages\tornado\http1connection.py", line 34, in <module>
from tornado import iostream
File "C:\Users\Sanja\Documents\app1\venv\lib\site-packages\tornado\iostream.py", line 40, in <module>
from tornado.netutil import ssl_wrap_socket, _client_ssl_defaults, _server_ssl_defaults
File "C:\Users\Sanja\Documents\app1\venv\lib\site-packages\tornado\netutil.py", line 35, in <module>
_client_ssl_defaults = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
File "C:\Users\Sanja\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 771, in create_default_context
context.load_default_certs(purpose)
File "C:\Users\Sanja\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 592, in load_default_certs
self._load_windows_store_certs(storename, purpose)
File "C:\Users\Sanja\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 584, in _load_windows_store_certs
self.load_verify_locations(cadata=certs)
ssl.SSLError: [ASN1] nested asn1 error (_ssl.c:4004)
I have tried to downgrade streamlit to 1.14.0 as advised somewhere, but didn't help.
Can you please advise, so I can continue my learning process?
I have tried dot downgrade stremline to 1.14.0
This question already has answers here:
How do I use installed packages in PyCharm?
(14 answers)
Closed 1 year ago.
When I run this code, from flask_wtf import FlaskForm I get an error,
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'flask_wtf'
I've installed the flask-wtf package through CMD,
pip install flask-wtf
and it gave me the confirmation that the package has been successfully installed
Requirement already satisfied: flask-wtf in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (0.15.1)
Requirement already satisfied: WTForms in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from flask-wtf) (2.3.3)
Requirement already satisfied: Flask in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from flask-wtf) (2.0.1)
Requirement already satisfied: itsdangerous in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from flask-wtf) (2.0.1)
Requirement already satisfied: Jinja2>=3.0 in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from Flask->flask-wtf) (3.0.1)
Requirement already satisfied: Werkzeug>=2.0 in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from Flask->flask-wtf) (2.0.1)
Requirement already satisfied: click>=7.1.2 in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from Flask->flask-wtf) (8.0.1)
Requirement already satisfied: colorama in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from click>=7.1.2->Flask->flask-wtf) (0.4.4)
Requirement already satisfied: importlib-metadata in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from click>=7.1.2->Flask->flask-wtf) (4.8.1)
Requirement already satisfied: MarkupSafe>=2.0 in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from Jinja2>=3.0->Flask->flask-wtf) (2.0.1)
Requirement already satisfied: typing-extensions>=3.6.4 in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from importlib-metadata->click>=7.1.2->Flask->flask-wtf) (3.10.0.2)
Requirement already satisfied: zipp>=0.5 in c:\users\zzz\appdata\local\programs\python\python37\lib\site-packages (from importlib-metadata->click>=7.1.2->Flask->flask-wtf) (3.5.0)
fixed by installing the flask-wtf package directly from PyCharm.
ctrl + alt+ S and then Python Interpreters hit the + sign and then type flask-wtf and download the package.
MY CODE:
import wikipedia
from wikipedia import *
search=wikipedia.search("apple")
print(search)
ERROR:
File "c:\Users\user\OneDrive\Desktop\demoprojects\web scraping\wikipedia.py", line 2, in <module>
import wikipedia
File "c:\Users\user\OneDrive\Desktop\demoprojects\web scraping\wikipedia.py", line 7, in <module>
search=wikipedia.search("apple")
AttributeError: partially initialized module 'wikipedia' has no attribute 'search' (most likely due to a circular import)
when i used pip install wikipedia it shows this:
Requirement already satisfied: wikipedia in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (1.4.0)
Requirement already satisfied: beautifulsoup4 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from wikipedia) (4.9.3)
Requirement already satisfied: requests<3.0.0,>=2.0.0 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from wikipedia) (2.26.0)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from requests<3.0.0,>=2.0.0->wikipedia) (2.0.4)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from requests<3.0.0,>=2.0.0->wikipedia) (2020.12.5)
Requirement already satisfied: idna<4,>=2.5 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from requests<3.0.0,>=2.0.0->wikipedia) (2.10)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from requests<3.0.0,>=2.0.0->wikipedia) (1.26.4)
Requirement already satisfied: soupsieve>1.2 in c:\users\user\appdata\local\programs\python\python39\lib\site-packages (from beautifulsoup4->wikipedia) (2.2.1)
"c:\Users\user\OneDrive\Desktop\demoprojects\web scraping\wikipedia.py"
You have a file named wikipedia.py. When you do import wikipedia, you are basically importing your own file instead of wikipedia module. So rename you file to something else.
Libraries are installed - not sure why this is throwing an error.
It works on one of my rigs with the same platform - ubuntu 19.10 - python3.8 and the associated libraries in a virtualenv.
I'm going to show you what I see:
Here's im trying to validate spacy -- which fails.
(p3env) gordon#citadel:~/p3env/alice/alice/spiders$ python -m spacy validate
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.8/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.8/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/home/gordon/p3env/lib/python3.8/site-packages/spacy/__init__.py", line 10, in <module>
from thinc.neural.util import prefer_gpu, require_gpu
File "/home/gordon/p3env/lib/python3.8/site-packages/thinc/neural/__init__.py", line 4, in <module>
from ._classes.model import Model # noqa: F401
File "/home/gordon/p3env/lib/python3.8/site-packages/thinc/neural/_classes/model.py", line 7, in <module>
import srsly
File "/home/gordon/p3env/lib/python3.8/site-packages/srsly/__init__.py", line 7, in <module>
from ._pickle_api import pickle_dumps, pickle_loads
File "/home/gordon/p3env/lib/python3.8/site-packages/srsly/_pickle_api.py", line 4, in <module>
from . import cloudpickle
File "/home/gordon/p3env/lib/python3.8/site-packages/srsly/cloudpickle/__init__.py", line 1, in <module>
from .cloudpickle import *
File "/home/gordon/p3env/lib/python3.8/site-packages/srsly/cloudpickle/cloudpickle.py", line 167, in <module>
_cell_set_template_code = _make_cell_set_template_code()
File "/home/gordon/p3env/lib/python3.8/site-packages/srsly/cloudpickle/cloudpickle.py", line 148, in _make_cell_set_template_code
return types.CodeType(
TypeError: an integer is required (got type bytes)
(p3env) gordon#citadel:~/p3env/alice/alice/spiders$ ^C
So I just try to install some of those libraries which turn out to be present. - I know everything I need is installed --
(p3env) gordon#citadel:~/p3env/alice/alice/spiders$ pip install thinc
Requirement already satisfied: thinc in /home/gordon/p3env/lib/python3.8/site-packages (7.1.1)
Requirement already satisfied: plac<1.0.0,>=0.9.6 in /home/gordon/p3env/lib/python3.8/site-packages (from thinc) (0.9.6)
Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /home/gordon/p3env/lib/python3.8/site-packages (from thinc) (1.0.2)
Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /home/gordon/p3env/lib/python3.8/site-packages (from thinc) (2.0.2)
Requirement already satisfied: numpy>=1.7.0 in /home/gordon/p3env/lib/python3.8/site-packages (from thinc) (1.17.3)
Requirement already satisfied: blis<0.5.0,>=0.4.0 in /home/gordon/p3env/lib/python3.8/site-packages (from thinc) (0.4.1)
Requirement already satisfied: srsly<1.1.0,>=0.0.6 in /home/gordon/p3env/lib/python3.8/site-packages (from thinc) (0.1.0)
Requirement already satisfied: tqdm<5.0.0,>=4.10.0 in /home/gordon/p3env/lib/python3.8/site-packages (from thinc) (4.36.1)
Requirement already satisfied: wasabi<1.1.0,>=0.0.9 in /home/gordon/p3env/lib/python3.8/site-packages (from thinc) (0.3.0)
Requirement already satisfied: preshed<3.1.0,>=1.0.1 in /home/gordon/p3env/lib/python3.8/site-packages (from thinc) (3.0.2)
(p3env) gordon#citadel:~/p3env/alice/alice/spiders$ pip install cloudpickle
Requirement already satisfied: cloudpickle in /home/gordon/p3env/lib/python3.8/site-packages (1.2.2)
(p3env) gordon#citadel:~/p3env/alice/alice/spiders$ pip install srsly
Requirement already satisfied: srsly in /home/gordon/p3env/lib/python3.8/site-packages (0.1.0)
(p3env) gordon#citadel:~/p3env/alice/alice/spiders$ pip install spacy
Requirement already satisfied: spacy in /home/gordon/p3env/lib/python3.8/site-packages (2.2.1)
Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /home/gordon/p3env/lib/python3.8/site-packages (from spacy) (3.0.2)
Requirement already satisfied: numpy>=1.15.0 in /home/gordon/p3env/lib/python3.8/site-packages (from spacy) (1.17.3)
Requirement already satisfied: requests<3.0.0,>=2.13.0 in /home/gordon/p3env/lib/python3.8/site-packages (from spacy) (2.22.0)
Requirement already satisfied: blis<0.5.0,>=0.4.0 in /home/gordon/p3env/lib/python3.8/site-packages (from spacy) (0.4.1)
Requirement already satisfied: srsly<1.1.0,>=0.1.0 in /home/gordon/p3env/lib/python3.8/site-packages (from spacy) (0.1.0)
Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /home/gordon/p3env/lib/python3.8/site-packages (from spacy) (1.0.2)
Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /home/gordon/p3env/lib/python3.8/site-packages (from spacy) (2.0.2)
Requirement already satisfied: thinc<7.2.0,>=7.1.1 in /home/gordon/p3env/lib/python3.8/site-packages (from spacy) (7.1.1)
Requirement already satisfied: wasabi<1.1.0,>=0.2.0 in /home/gordon/p3env/lib/python3.8/site-packages (from spacy) (0.3.0)
Requirement already satisfied: plac<1.0.0,>=0.9.6 in /home/gordon/p3env/lib/python3.8/site-packages (from spacy) (0.9.6)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /home/gordon/p3env/lib/python3.8/site-packages (from requests<3.0.0,>=2.13.0->spacy) (1.25.6)
Requirement already satisfied: idna<2.9,>=2.5 in /home/gordon/p3env/lib/python3.8/site-packages (from requests<3.0.0,>=2.13.0->spacy) (2.8)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /home/gordon/p3env/lib/python3.8/site-packages (from requests<3.0.0,>=2.13.0->spacy) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /home/gordon/p3env/lib/python3.8/site-packages (from requests<3.0.0,>=2.13.0->spacy) (2019.9.11)
Requirement already satisfied: tqdm<5.0.0,>=4.10.0 in /home/gordon/p3env/lib/python3.8/site-packages (from thinc<7.2.0,>=7.1.1->spacy) (4.36.1)
(p3env) gordon#citadel:~/p3env/alice/alice/spiders$ pip uninstall spacy
Uninstalling spacy-2.2.1:
Would remove:
/home/gordon/p3env/bin/spacy
/home/gordon/p3env/lib/python3.8/site-packages/bin/*
/home/gordon/p3env/lib/python3.8/site-packages/spacy-2.2.1.dist-info/*
/home/gordon/p3env/lib/python3.8/site-packages/spacy/*
Proceed (y/n)? y
Successfully uninstalled spacy-2.2.1
(p3env) gordon#citadel:~/p3env/alice/alice/spiders$ pip install spacy
Processing /home/gordon/snap/code/common/.cache/pip/wheels/1d/22/2b/2d5d8fe5e5fe728a766158a89d017051c19005bb7aabc1d79a/spacy-2.2.1-cp38-cp38-linux_x86_64.whl
Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /home/gordon/p3env/lib/python3.8/site-packages (from spacy) (1.0.2)
Requirement already satisfied: blis<0.5.0,>=0.4.0 in /home/gordon/p3env/lib/python3.8/site-packages (from spacy) (0.4.1)
Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /home/gordon/p3env/lib/python3.8/site-packages (from spacy) (3.0.2)
Requirement already satisfied: requests<3.0.0,>=2.13.0 in /home/gordon/p3env/lib/python3.8/site-packages (from spacy) (2.22.0)
Requirement already satisfied: srsly<1.1.0,>=0.1.0 in /home/gordon/p3env/lib/python3.8/site-packages (from spacy) (0.1.0)
Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /home/gordon/p3env/lib/python3.8/site-packages (from spacy) (2.0.2)
Requirement already satisfied: plac<1.0.0,>=0.9.6 in /home/gordon/p3env/lib/python3.8/site-packages (from spacy) (0.9.6)
Requirement already satisfied: thinc<7.2.0,>=7.1.1 in /home/gordon/p3env/lib/python3.8/site-packages (from spacy) (7.1.1)
Requirement already satisfied: wasabi<1.1.0,>=0.2.0 in /home/gordon/p3env/lib/python3.8/site-packages (from spacy) (0.3.0)
Requirement already satisfied: numpy>=1.15.0 in /home/gordon/p3env/lib/python3.8/site-packages (from spacy) (1.17.3)
Requirement already satisfied: certifi>=2017.4.17 in /home/gordon/p3env/lib/python3.8/site-packages (from requests<3.0.0,>=2.13.0->spacy) (2019.9.11)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /home/gordon/p3env/lib/python3.8/site-packages (from requests<3.0.0,>=2.13.0->spacy) (1.25.6)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /home/gordon/p3env/lib/python3.8/site-packages (from requests<3.0.0,>=2.13.0->spacy) (3.0.4)
Requirement already satisfied: idna<2.9,>=2.5 in /home/gordon/p3env/lib/python3.8/site-packages (from requests<3.0.0,>=2.13.0->spacy) (2.8)
Requirement already satisfied: tqdm<5.0.0,>=4.10.0 in /home/gordon/p3env/lib/python3.8/site-packages (from thinc<7.2.0,>=7.1.1->spacy) (4.36.1)
Installing collected packages: spacy
Successfully installed spacy-2.2.1
RIGHT HERE -- I just try importing spacy and this is what I'm getting on one of the machines... while the other works -- odd I'll need to look into this -
Has anyone run into this ?
(p3env) gordon#citadel:~/p3env/alice/alice/spiders$ python
Python 3.8.0 (default, Oct 15 2019, 09:10:20)
[GCC 9.2.1 20191008] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import spacy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/gordon/p3env/lib/python3.8/site-packages/spacy/__init__.py", line 10, in <module>
from thinc.neural.util import prefer_gpu, require_gpu
File "/home/gordon/p3env/lib/python3.8/site-packages/thinc/neural/__init__.py", line 4, in <module>
from ._classes.model import Model # noqa: F401
File "/home/gordon/p3env/lib/python3.8/site-packages/thinc/neural/_classes/model.py", line 7, in <module>
import srsly
File "/home/gordon/p3env/lib/python3.8/site-packages/srsly/__init__.py", line 7, in <module>
from ._pickle_api import pickle_dumps, pickle_loads
File "/home/gordon/p3env/lib/python3.8/site-packages/srsly/_pickle_api.py", line 4, in <module>
from . import cloudpickle
File "/home/gordon/p3env/lib/python3.8/site-packages/srsly/cloudpickle/__init__.py", line 1, in <module>
from .cloudpickle import *
File "/home/gordon/p3env/lib/python3.8/site-packages/srsly/cloudpickle/cloudpickle.py", line 167, in <module>
_cell_set_template_code = _make_cell_set_template_code()
File "/home/gordon/p3env/lib/python3.8/site-packages/srsly/cloudpickle/cloudpickle.py", line 148, in _make_cell_set_template_code
return types.CodeType(
TypeError: an integer is required (got type bytes
I don't believe this happens outside of the virtualenv.
Let me know if you have seen this one, when I fix it I'll update the post.
$ python3.8 -m pip install srsly --upgrade
Defaulting to user installation because normal site-packages is not writeable
Collecting srsly
Downloading srsly-2.0.0-cp38-cp38-manylinux1_x86_64.whl (311 kB)
|████████████████████████████████| 311 kB 1.3 MB/s
ERROR: thinc 7.3.1 has requirement srsly<1.1.0,>=0.0.6, but you'll have srsly 2.0.0 which is incompatible.
ERROR: spacy 2.2.3 has requirement srsly<1.1.0,>=0.1.0, but you'll have srsly 2.0.0 which is incompatible.
Installing collected packages: srsly
Attempting uninstall: srsly
Found existing installation: srsly 0.1.0
Uninstalling srsly-0.1.0:
Successfully uninstalled srsly-0.1.0
Successfully installed srsly-2.0.0
You might want to use python3.8 -m pip install srsly==1.0.1.
I am using the airflow application on my Linux server
note - Airflow is a platform to programmatically author, schedule and monitor workflows.
from some unclear reason we get the following issues ( when we restart the airflow or initialize the database , )
what should I check regarding the following errors?
airflow webserver
Traceback (most recent call last):
File "/usr/bin/airflow", line 4, in <module>
from airflow import configuration
File "/usr/lib/python2.7/site-packages/airflow/__init__.py", line 29, in <module>
from airflow import configuration as conf
File "/usr/lib/python2.7/site-packages/airflow/configuration.py", line 657, in <module>
conf.read(AIRFLOW_CONFIG)
File "/usr/lib/python2.7/site-packages/airflow/configuration.py", line 519, in read
self._validate()
File "/usr/lib/python2.7/site-packages/airflow/configuration.py", line 447, in _validate
"sqlite" in self.get('core', 'sql_alchemy_conn')):
File "/usr/lib/python2.7/site-packages/airflow/configuration.py", line 484, in get
option = self._get_cmd_option(section, key)
File "/usr/lib/python2.7/site-packages/airflow/configuration.py", line 465, in _get_cmd_option
return run_command(command)
File "/usr/lib/python2.7/site-packages/airflow/configuration.py", line 70, in run_command
.format(command, process.returncode, output, stderr)
airflow.configuration.AirflowConfigException: Cannot execute python /home/airflow/.sec/security.py get_connection_string pg. Error code is: 1. Output: , Stderr: Traceback (most recent call last):
File "/home/airflow/.sec/security.py", line 4, in <module>
from cryptography.fernet import Fernet
ImportError: No module named cryptography.fernet
# airflow initdb
Traceback (most recent call last):
File "/usr/bin/airflow", line 4, in <module>
from airflow import configuration
File "/usr/lib/python2.7/site-packages/airflow/__init__.py", line 29, in <module>
from airflow import configuration as conf
File "/usr/lib/python2.7/site-packages/airflow/configuration.py", line 657, in <module>
conf.read(AIRFLOW_CONFIG)
File "/usr/lib/python2.7/site-packages/airflow/configuration.py", line 519, in read
self._validate()
File "/usr/lib/python2.7/site-packages/airflow/configuration.py", line 447, in _validate
"sqlite" in self.get('core', 'sql_alchemy_conn')):
File "/usr/lib/python2.7/site-packages/airflow/configuration.py", line 484, in get
option = self._get_cmd_option(section, key)
File "/usr/lib/python2.7/site-packages/airflow/configuration.py", line 465, in _get_cmd_option
return run_command(command)
File "/usr/lib/python2.7/site-packages/airflow/configuration.py", line 70, in run_command
.format(command, process.returncode, output, stderr)
airflow.configuration.AirflowConfigException: Cannot execute python /home/airflow/.sec/security.py get_connection_string pg. Error code is: 1. Output: , Stderr: Traceback (most recent call last):
File "/home/airflow/.sec/security.py", line 4, in <module>
from cryptography.fernet import Fernet
ImportError: No module named cryptography.fernet
]# airflow list_dags
Traceback (most recent call last):
File "/usr/bin/airflow", line 4, in <module>
from airflow import configuration
File "/usr/lib/python2.7/site-packages/airflow/__init__.py", line 29, in <module>
from airflow import configuration as conf
File "/usr/lib/python2.7/site-packages/airflow/configuration.py", line 657, in <module>
conf.read(AIRFLOW_CONFIG)
File "/usr/lib/python2.7/site-packages/airflow/configuration.py", line 519, in read
self._validate()
File "/usr/lib/python2.7/site-packages/airflow/configuration.py", line 447, in _validate
"sqlite" in self.get('core', 'sql_alchemy_conn')):
File "/usr/lib/python2.7/site-packages/airflow/configuration.py", line 484, in get
option = self._get_cmd_option(section, key)
File "/usr/lib/python2.7/site-packages/airflow/configuration.py", line 465, in _get_cmd_option
return run_command(command)
File "/usr/lib/python2.7/site-packages/airflow/configuration.py", line 70, in run_command
.format(command, process.returncode, output, stderr)
airflow.configuration.AirflowConfigException: Cannot execute python /home/airflow/.sec/security.py get_connection_string pg. Error code is: 1. Output: , Stderr: Traceback (most recent call last):
File "/home/airflow/.sec/security.py", line 4, in <module>
from cryptography.fernet import Fernet
ImportError: No module named cryptography.fernet
we try also
pip install "apache-airflow[crypto]"
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting apache-airflow[crypto]
Using cached https://files.pythonhosted.org/packages/74/cb/3a4bcfcdb75897607c0c4d9ec17f3c3d6eb4973930d2fa59bd0b47c20a67/apache_airflow-1.10.6-py2.py3-none-any.whl
Requirement already satisfied: setproctitle<2,>=1.1.8 in /usr/lib64/python2.7/site-packages (from apache-airflow[crypto]) (1.1.10)
Requirement already satisfied: termcolor==1.1.0 in /usr/lib/python2.7/site-packages (from apache-airflow[crypto]) (1.1.0)
Requirement already satisfied: colorlog==4.0.2 in /usr/lib/python2.7/site-packages (from apache-airflow[crypto]) (4.0.2)
Requirement already satisfied: dill<0.4,>=0.2.2 in /usr/lib/python2.7/site-packages (from apache-airflow[crypto]) (0.2.5)
Requirement already satisfied: typing; python_version < "3.5" in /usr/lib/python2.7/site-packages (from apache-airflow[crypto]) (3.7.4.1)
Collecting flask-admin==1.5.3
Using cached https://files.pythonhosted.org/packages/c3/bc/4cb71a88d8b0d478ed7f46e7bba632e988daae5ae07ce5413a31acbe8166/Flask-Admin-1.5.3.tar.gz
Collecting flask-login<0.5,>=0.3
Using cached https://files.pythonhosted.org/packages/c1/ff/bd9a4d2d81bf0c07d9e53e8cd3d675c56553719bbefd372df69bf1b3c1e4/Flask-Login-0.4.1.tar.gz
Requirement already satisfied: markdown<3.0,>=2.5.2 in /usr/lib/python2.7/site-packages (from apache-airflow[crypto]) (2.6.7)
Requirement already satisfied: unicodecsv>=0.14.1 in /usr/lib/python2.7/site-packages (from apache-airflow[crypto]) (0.14.1)
Requirement already satisfied: flask-caching<1.4.0,>=1.3.3 in /usr/lib64/python2.7/site-packages (from apache-airflow[crypto]) (1.3.3)
Requirement already satisfied: enum34~=1.1.6; python_version < "3.4" in /usr/lib/python2.7/site-packages (from apache-airflow[crypto]) (1.1.6)
Requirement already satisfied: text-unidecode==1.2 in /usr/lib/python2.7/site-packages (from apache-airflow[crypto]) (1.2)
Collecting flask-wtf<0.15,>=0.14.2
Using cached https://files.pythonhosted.org/packages/60/3a/58c629472d10539ae5167dc7c1fecfa95dd7d0b7864623931e3776438a24/Flask_WTF-0.14.2-py2.py3-none-any.whl
Requirement already satisfied: cached-property~=1.5 in /usr/lib/python2.7/site-packages (from apache-airflow[crypto]) (1.5.1)
Requirement already satisfied: graphviz>=0.12 in /usr/lib/python2.7/site-packages (from apache-airflow[crypto]) (0.13.2)
Collecting gunicorn<20.0,>=19.5.0
Using cached https://files.pythonhosted.org/packages/8c/da/b8dd8deb741bff556db53902d4706774c8e1e67265f69528c14c003644e6/gunicorn-19.9.0-py2.py3-none-any.whl
Requirement already satisfied: tabulate<0.9,>=0.7.5 in /usr/lib/python2.7/site-packages (from apache-airflow[crypto]) (0.8.5)
Requirement already satisfied: python-dateutil<3,>=2.3 in /usr/lib/python2.7/site-packages (from apache-airflow[crypto]) (2.6.0)
Requirement already satisfied: tenacity==4.12.0 in /usr/lib/python2.7/site-packages (from apache-airflow[crypto]) (4.12.0)
Requirement already satisfied: lazy-object-proxy~=1.3 in /usr/lib64/python2.7/site-packages (from apache-airflow[crypto]) (1.4.3)
Requirement already satisfied: flask-swagger==0.2.13 in /usr/lib/python2.7/site-packages (from apache-airflow[crypto]) (0.2.13)
Collecting flask<2.0,>=1.1.0
Using cached https://files.pythonhosted.org/packages/9b/93/628509b8d5dc749656a9641f4caf13540e2cdec85276964ff8f43bbb1d3b/Flask-1.1.1-py2.py3-none-any.whl
Requirement already satisfied: argcomplete~=1.10 in /usr/lib/python2.7/site-packages (from apache-airflow[crypto]) (1.10.0)
Requirement already satisfied: marshmallow-sqlalchemy<0.19.0,>=0.16.1 in /usr/lib/python2.7/site-packages (from apache-airflow[crypto]) (0.18.0)
Requirement already satisfied: croniter<0.4,>=0.3.17 in /usr/lib/python2.7/site-packages (from apache-airflow[crypto]) (0.3.30)
Requirement already satisfied: configparser<3.6.0,>=3.5.0 in /usr/lib/python2.7/site-packages (from apache-airflow[crypto]) (3.5.3)
Requirement already satisfied: zope.deprecation<5.0,>=4.0 in /usr/lib/python2.7/site-packages (from apache-airflow[crypto]) (4.4.0)
Requirement already satisfied: sqlalchemy~=1.3 in /usr/lib64/python2.7/site-packages (from apache-airflow[crypto]) (1.3.10)
Collecting flask-appbuilder<2.0.0,>=1.12.5
Using cached https://files.pythonhosted.org/packages/90/9f/d8c4e693eb208042cc6dffcfa7b407db8e36cc89ec790a53d7cea5fa4bb8/Flask-AppBuilder-1.13.1.tar.gz
Processing /root/.cache/pip/wheels/2f/4c/cd/f0cabf03ccb7edd9002875db9001108b33ebfc60b4ff9a61ae/pendulum-1.4.4-cp27-cp27mu-linux_x86_64.whl
Collecting psutil<6.0.0,>=4.2.0
Using cached https://files.pythonhosted.org/packages/03/9a/95c4b3d0424426e5fd94b5302ff74cea44d5d4f53466e1228ac8e73e14b4/psutil-5.6.5.tar.gz
Collecting funcsigs==1.0.0
Using cached https://files.pythonhosted.org/packages/09/8d/17528625d12ca90651dd1f7958fd0d32b23b15f2197023372669fd683321/funcsigs-1.0.0-py2.py3-none-any.whl
Collecting future<0.17,>=0.16.0
Using cached https://files.pythonhosted.org/packages/00/2b/8d082ddfed935f3608cc61140df6dcbf0edea1bc3ab52fb6c29ae3e81e85/future-0.16.0.tar.gz
Collecting requests<3,>=2.20.0
Using cached https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl
Requirement already satisfied: thrift>=0.9.2 in /usr/lib64/python2.7/site-packages (from apache-airflow[crypto]) (0.9.3)
Collecting alembic<2.0,>=1.0
Using cached https://files.pythonhosted.org/packages/70/3d/d5ed7a71fe84f9ed0a69e91232a40b0b148b151524dc5bb1c8e4211eb117/alembic-1.3.0.tar.gz
Collecting json-merge-patch==0.2
Using cached https://files.pythonhosted.org/packages/39/62/3b783faabac9a099877397d8f7a7cc862a03fbf9fb1b90d414ea7c6bb096/json-merge-patch-0.2.tar.gz
Collecting tzlocal<2.0.0,>=1.4
Using cached https://files.pythonhosted.org/packages/cb/89/e3687d3ed99bc882793f82634e9824e62499fdfdc4b1ae39e211c5b05017/tzlocal-1.5.1.tar.gz
Requirement already satisfied: jinja2<2.11.0,>=2.10.1 in /usr/lib64/python2.7/site-packages (from apache-airflow[crypto]) (2.10.3)
Requirement already satisfied: pygments<3.0,>=2.0.1 in /usr/lib64/python2.7/site-packages (from apache-airflow[crypto]) (2.1.3)
Collecting iso8601>=0.1.12
Using cached https://files.pythonhosted.org/packages/ef/57/7162609dab394d38bbc7077b7ba0a6f10fb09d8b7701ea56fa1edc0c4345/iso8601-0.1.12-py2.py3-none-any.whl
Requirement already satisfied: pandas<1.0.0,>=0.17.1 in /usr/lib64/python2.7/site-packages (from apache-airflow[crypto]) (0.19.2)
Requirement already satisfied: python-daemon<2.2,>=2.1.1 in /usr/lib/python2.7/site-packages (from apache-airflow[crypto]) (2.1.2)
Requirement already satisfied: cryptography>=0.9.3; extra == "crypto" in /usr/lib64/python2.7/site-packages (from apache-airflow[crypto]) (1.7.1)
Requirement already satisfied: wtforms in /usr/lib/python2.7/site-packages (from flask-admin==1.5.3->apache-airflow[crypto]) (2.1)
Requirement already satisfied: Werkzeug>=0.12 in /usr/lib/python2.7/site-packages (from flask-caching<1.4.0,>=1.3.3->apache-airflow[crypto]) (0.12.1)
Requirement already satisfied: six>=1.5 in /usr/lib/python2.7/site-packages (from python-dateutil<3,>=2.3->apache-airflow[crypto]) (1.9.0)
Requirement already satisfied: monotonic>=0.6; python_version == "2.7" in /usr/lib/python2.7/site-packages (from tenacity==4.12.0->apache-airflow[crypto]) (1.5)
Requirement already satisfied: futures>=3.0; python_version == "2.7" in /usr/lib/python2.7/site-packages (from tenacity==4.12.0->apache-airflow[crypto]) (3.3.0)
Requirement already satisfied: PyYAML>=3.0 in /usr/lib64/python2.7/site-packages (from flask-swagger==0.2.13->apache-airflow[crypto]) (3.12)
Requirement already satisfied: click>=5.1 in /usr/lib64/python2.7/site-packages (from flask<2.0,>=1.1.0->apache-airflow[crypto]) (7.0)
Requirement already satisfied: itsdangerous>=0.24 in /usr/lib/python2.7/site-packages (from flask<2.0,>=1.1.0->apache-airflow[crypto]) (0.24)
Requirement already satisfied: marshmallow>=2.0.0 in /usr/lib/python2.7/site-packages (from marshmallow-sqlalchemy<0.19.0,>=0.16.1->apache-airflow[crypto]) (2.20.5)
Requirement already satisfied: setuptools in /usr/lib/python2.7/site-packages (from zope.deprecation<5.0,>=4.0->apache-airflow[crypto]) (32.3.1)
Requirement already satisfied: colorama<1,>=0.3.9 in /usr/lib/python2.7/site-packages (from flask-appbuilder<2.0.0,>=1.12.5->apache-airflow[crypto]) (0.4.1)
Requirement already satisfied: apispec[yaml]>=1.1.1<2 in /usr/lib/python2.7/site-packages (from flask-appbuilder<2.0.0,>=1.12.5->apache-airflow[crypto]) (2.0.2)
Requirement already satisfied: Flask-Babel<1,>=0.11.1 in /usr/lib/python2.7/site-packages (from flask-appbuilder<2.0.0,>=1.12.5->apache-airflow[crypto]) (0.12.2)
Requirement already satisfied: Flask-OpenID<2,>=1.2.5 in /usr/lib/python2.7/site-packages (from flask-appbuilder<2.0.0,>=1.12.5->apache-airflow[crypto]) (1.2.5)
Requirement already satisfied: Flask-SQLAlchemy<3,>=2.3 in /usr/lib/python2.7/site-packages (from flask-appbuilder<2.0.0,>=1.12.5->apache-airflow[crypto]) (2.4.1)
Requirement already satisfied: Flask-JWT-Extended<4,>=3.18 in /usr/lib/python2.7/site-packages (from flask-appbuilder<2.0.0,>=1.12.5->apache-airflow[crypto]) (3.24.1)
Requirement already satisfied: marshmallow-enum<2,>=1.4.1 in /usr/lib/python2.7/site-packages (from flask-appbuilder<2.0.0,>=1.12.5->apache-airflow[crypto]) (1.5.1)
Collecting prison==0.1.0
Using cached https://files.pythonhosted.org/packages/a1/c4/076e1e2677ef928765b0fb537be6476fb8a96624be4669fb5a0618b32455/prison-0.1.0-py2.py3-none-any.whl
Collecting jsonschema>=3.0.1<4
Using cached https://files.pythonhosted.org/packages/ce/6c/888d7c3c1fce3974c88a01a6bc553528c99d3586e098eee23e8383dd11c3/jsonschema-3.1.1-py2.py3-none-any.whl
Requirement already satisfied: PyJWT>=1.7.1 in /usr/lib/python2.7/site-packages (from flask-appbuilder<2.0.0,>=1.12.5->apache-airflow[crypto]) (1.7.1)
Collecting pytzdata>=2018.3.0.0
Using cached https://files.pythonhosted.org/packages/7f/f9/cdd39831b0465285c02ed90cfbf0db25bb951cb2a35ded0e69222375bea3/pytzdata-2019.3-py2.py3-none-any.whl
Collecting ordereddict
Using cached https://files.pythonhosted.org/packages/53/25/ef88e8e45db141faa9598fbf7ad0062df8f50f881a36ed6a0073e1572126/ordereddict-1.1.tar.gz
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python2.7/site-packages (from requests<3,>=2.20.0->apache-airflow[crypto]) (3.0.4)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/lib/python2.7/site-packages (from requests<3,>=2.20.0->apache-airflow[crypto]) (2.8)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/lib/python2.7/site-packages (from requests<3,>=2.20.0->apache-airflow[crypto]) (1.25.6)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python2.7/site-packages (from requests<3,>=2.20.0->apache-airflow[crypto]) (2019.9.11)
Requirement already satisfied: Mako in /usr/lib/python2.7/site-packages (from alembic<2.0,>=1.0->apache-airflow[crypto]) (1.0.6)
Requirement already satisfied: python-editor>=0.3 in /usr/lib/python2.7/site-packages (from alembic<2.0,>=1.0->apache-airflow[crypto]) (1.0.3)
Requirement already satisfied: pytz in /usr/lib/python2.7/site-packages (from tzlocal<2.0.0,>=1.4->apache-airflow[crypto]) (2016.10)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/lib64/python2.7/site-packages (from jinja2<2.11.0,>=2.10.1->apache-airflow[crypto]) (1.0)
Requirement already satisfied: numpy>=1.7.0 in /usr/lib64/python2.7/site-packages (from pandas<1.0.0,>=0.17.1->apache-airflow[crypto]) (1.11.3)
Requirement already satisfied: docutils in /usr/lib/python2.7/site-packages (from python-daemon<2.2,>=2.1.1->apache-airflow[crypto]) (0.13.1)
Requirement already satisfied: lockfile>=0.10 in /usr/lib/python2.7/site-packages (from python-daemon<2.2,>=2.1.1->apache-airflow[crypto]) (0.12.2)
Requirement already satisfied: pyasn1>=0.1.8 in /usr/lib/python2.7/site-packages (from cryptography>=0.9.3; extra == "crypto"->apache-airflow[crypto]) (0.1.9)
Requirement already satisfied: ipaddress in /usr/lib/python2.7/site-packages (from cryptography>=0.9.3; extra == "crypto"->apache-airflow[crypto]) (1.0.17)
Requirement already satisfied: cffi>=1.4.1 in /usr/lib64/python2.7/site-packages (from cryptography>=0.9.3; extra == "crypto"->apache-airflow[crypto]) (1.9.1)
Collecting Babel>=2.3
Using cached https://files.pythonhosted.org/packages/2c/60/f2af68eb046c5de5b1fe6dd4743bf42c074f7141fe7b2737d3061533b093/Babel-2.7.0-py2.py3-none-any.whl
Requirement already satisfied: python-openid>=2.0 in /usr/lib/python2.7/site-packages (from Flask-OpenID<2,>=1.2.5->flask-appbuilder<2.0.0,>=1.12.5->apache-airflow[crypto]) (2.2.5)
Collecting pyrsistent>=0.14.0
Using cached https://files.pythonhosted.org/packages/30/86/53a88c0a57698fa228db29a4000c28f4124823010388cb7042fe6e2be8dd/pyrsistent-0.15.5.tar.gz
Collecting attrs>=17.4.0
Using cached https://files.pythonhosted.org/packages/a2/db/4313ab3be961f7a763066401fb77f7748373b6094076ae2bda2806988af6/attrs-19.3.0-py2.py3-none-any.whl
Collecting importlib-metadata
Using cached https://files.pythonhosted.org/packages/f6/d2/40b3fa882147719744e6aa50ac39cf7a22a913cbcba86a0371176c425a3b/importlib_metadata-0.23-py2.py3-none-any.whl
Collecting functools32; python_version < "3"
Using cached https://files.pythonhosted.org/packages/c5/60/6ac26ad05857c601308d8fb9e87fa36d0ebf889423f47c3502ef034365db/functools32-3.2.3-2.tar.gz
Requirement already satisfied: pycparser in /usr/lib/python2.7/site-packages (from cffi>=1.4.1->cryptography>=0.9.3; extra == "crypto"->apache-airflow[crypto]) (2.17)
Collecting contextlib2; python_version < "3"
Using cached https://files.pythonhosted.org/packages/85/60/370352f7ef6aa96c52fb001831622f50f923c1d575427d021b8ab3311236/contextlib2-0.6.0.post1-py2.py3-none-any.whl
Collecting pathlib2; python_version == "3.4.*" or python_version < "3"
Using cached https://files.pythonhosted.org/packages/e9/45/9c82d3666af4ef9f221cbb954e1d77ddbb513faf552aea6df5f37f1a4859/pathlib2-2.3.5-py2.py3-none-any.whl
Collecting zipp>=0.5
Using cached https://files.pythonhosted.org/packages/74/3d/1ee25a26411ba0401b43c6376d2316a71addcc72ef8690b101b4ea56d76a/zipp-0.6.0-py2.py3-none-any.whl
Collecting scandir; python_version < "3.5"
Using cached https://files.pythonhosted.org/packages/df/f5/9c052db7bd54d0cbf1bc0bb6554362bba1012d03e5888950a4f5c5dadc4e/scandir-1.10.0.tar.gz
Collecting more-itertools
Using cached https://files.pythonhosted.org/packages/2f/9d/dcfe59e213093695f108508af1214cf9cd95cc5489e46877ec5cb56369e5/more_itertools-5.0.0-py2-none-any.whl
ERROR: flask 1.1.1 has requirement Werkzeug>=0.15, but you'll have werkzeug 0.12.1 which is incompatible.
ERROR: flask-appbuilder 1.13.1 has requirement marshmallow<2.20,>=2.18.0, but you'll have marshmallow 2.20.5 which is incompatible.
ERROR: airflow 1.7.1.3 has requirement alembic<0.9,>=0.8.3, but you'll have alembic 1.3.0 which is incompatible.
ERROR: airflow 1.7.1.3 has requirement babel<2.0,>=1.3, but you'll have babel 2.7.0 which is incompatible.
ERROR: airflow 1.7.1.3 has requirement flask<0.11,>=0.10.1, but you'll have flask 1.1.1 which is incompatible.
ERROR: airflow 1.7.1.3 has requirement flask-admin==1.4.0, but you'll have flask-admin 1.5.3 which is incompatible.
ERROR: airflow 1.7.1.3 has requirement flask-login==0.2.11, but you'll have flask-login 0.4.1 which is incompatible.
ERROR: airflow 1.7.1.3 has requirement Flask-WTF==0.12, but you'll have flask-wtf 0.14.2 which is incompatible.
ERROR: airflow 1.7.1.3 has requirement funcsigs<1,>=0.4, but you'll have funcsigs 1.0.0 which is incompatible.
ERROR: airflow 1.7.1.3 has requirement future<0.16,>=0.15.0, but you'll have future 0.16.0 which is incompatible.
ERROR: airflow 1.7.1.3 has requirement gunicorn<19.4.0,>=19.3.0, but you'll have gunicorn 19.9.0 which is incompatible.
ERROR: jsonschema 3.1.1 has requirement six>=1.11.0, but you'll have six 1.9.0 which is incompatible.
ERROR: flask-jwt-extended 3.24.1 has requirement Werkzeug>=0.14, but you'll have werkzeug 0.12.1 which is incompatible.
Installing collected packages: flask, flask-admin, flask-login, flask-wtf, gunicorn, requests, prison, pyrsistent, attrs, contextlib2, scandir, pathlib2, more-itertools, zipp, importlib-metadata, functools32, jsonschema, flask-appbuilder, pytzdata, tzlocal, pendulum, psutil, ordereddict, funcsigs, future, alembic, json-merge-patch, iso8601, apache-airflow, Babel
Found existing installation: Flask 0.10.1
Uninstalling Flask-0.10.1:
Successfully uninstalled Flask-0.10.1
Found existing installation: Flask-Admin 1.4.0
Uninstalling Flask-Admin-1.4.0:
Successfully uninstalled Flask-Admin-1.4.0
Running setup.py install for flask-admin ... done
Found existing installation: Flask-Login 0.2.11
Uninstalling Flask-Login-0.2.11:
Successfully uninstalled Flask-Login-0.2.11
Running setup.py install for flask-login ... done
Found existing installation: Flask-WTF 0.12
Uninstalling Flask-WTF-0.12:
Successfully uninstalled Flask-WTF-0.12
Found existing installation: gunicorn 19.3.0
Uninstalling gunicorn-19.3.0:
Successfully uninstalled gunicorn-19.3.0
Found existing installation: requests 2.6.0
ERROR: Cannot uninstall 'requests'. It is a distutils installed project and thus we cannot accurately deter
the airflow script
!/usr/bin/python2
# PYTHON_ARGCOMPLETE_OK
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import os
import argcomplete
from airflow.configuration import conf
from airflow.bin.cli import CLIFactory
if __name__ == '__main__':
if conf.get("core", "security") == 'kerberos':
os.environ['KRB5CCNAME'] = conf.get('kerberos', 'ccache')
os.environ['KRB5_KTNAME'] = conf.get('kerberos', 'keytab')
parser = CLIFactory.get_parser()
argcomplete.autocomplete(parser)
args = parser.parse_args()
args.func(args)
seems its not load the module as:
airflow
Traceback (most recent call last):
File "/usr/bin/airflow", line 25, in <module>
from airflow.configuration import conf
Can you install the following:
pip install "apache-airflow[crypto]"
This will encrypt the passwords field (in Airflow connections) in the Airlfow MetaDB
Did you add fernet key on airflow.cfg? there should be a line where you can put the fernet
# Secret key to save connection passwords in the db
fernet_key = {insert here}