geerlingguy / internet-pi

Raspberry Pi config for all things Internet.
MIT License
4.27k stars 448 forks source link

Error - ansible-playbook main.yml - Intstalling Docker Compose via Pip #77

Closed W00glin closed 2 years ago

W00glin commented 3 years ago

Howdy all,

Trying to install this on my raspberry pi 3 B+ and getting this error when running the ansible playbook. After doing some digging I think it might be that my machine is trying to run the playbook with python 2 as opposed to python 3 but that is a shaky guess at best.

TASK [Install Docker Compose using Pip.] *** An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ImportError: No module named pkg_resources fatal: [127.0.0.1]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (setuptools) on raspberrypi's Python /usr/bin/python. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"}

I did come across other similar errors telling me to re-install python-setuptools. I did that, retried and the error persists.

Any help and advice for a noob would be appreciated.

W00glin commented 3 years ago

To give an update I found - It looks like I did not have the pip for python 2 install so I installed that via sudo apt-get install python-pip and then re-ran the ansible playbook and got a different error this time.

TASK [Install Docker Compose using Pip.] *** fatal: [127.0.0.1]: FAILED! => {"changed": false, "cmd": ["/usr/bin/pip3", "install", "docker-compose"], "msg": "stdout: Collecting docker-compose\n Using cached https://files.pythonhosted.org/packages/f3/3e/ca05e486d44e38eb495ca60b8ca526b192071717387346ed1031ecf78966/docker_compose-1.29.2-py2.py3-none-any.whl\nRequirement already satisfied: PyYAML<6,>=3.10 in /usr/local/lib/python3.5/dist-packages (from docker-compose)\nCollecting python-dotenv<1,>=0.13.0 (from docker-compose)\n Using cached https://files.pythonhosted.org/packages/5c/0c/9c5d5dd254e9e7a32d34777cc6fd33cbeb174744061458b88470aecbd1d6/python_dotenv-0.18.0-py2.py3-none-any.whl\nCollecting docker[ssh]>=5 (from docker-compose)\n\n:stderr: Could not find a version that satisfies the requirement docker[ssh]>=5 (from docker-compose) (from versions: 2.0.0, 2.0.1, 2.0.2, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0, 2.4.1, 2.4.2, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.7.0, 3.0.0, 3.0.1, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.2.0, 3.2.1, 3.3.0, 3.4.0, 3.4.1, 3.5.0, 3.5.1, 3.6.0, 3.7.0, 3.7.1, 3.7.2, 3.7.3, 4.0.0, 4.0.1, 4.0.2, 4.1.0, 4.2.0, 4.2.1, 4.2.2, 4.3.0, 4.3.1, 4.4.0, 4.4.1, 4.4.2, 4.4.3, 4.4.4)\nNo matching distribution found for docker[ssh]>=5 (from docker-compose)\n"}

So a different error this time, but still not sure what could be causing it.

geerlingguy commented 3 years ago

@W00glin - You should really try to run this on Python 3 — ideally run pip uninstall ansible ansible-core to make sure it's gone. Then run sudo apt install -y python3-pip. Then pip3 install ansible, then try running this playbook again. Python 2 is EOL and hard to work with now.

W00glin commented 3 years ago

My mistake. I was under the impression I was attempting to run this playbook with python3. It might be obvious that I am not much of a developer or do a lot with ansible. I digress. I tried running the commands you listed and got an error Cannot uninstall requirement ansible, not installed. Re-ran the playbook and still got the same error.

Hat3 commented 3 years ago

Hello i else received the same error:

fatal: [127.0.0.1]: FAILED! => {"changed": false, "cmd": ["/usr/local/bin/pip3", "install", "docker-compose"], "msg": "stdout: Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple\nCollecting docker-compose\n  Using cached https://www.piwheels.org/simple/docker-compose/docker_compose-1.29.2-py2.py3-none-any.whl (114 kB)\nCollecting websocket-client<1,>=0.32.0\n  Using cached https://www.piwheels.org/simple/websocket-client/websocket_client-0.59.0-py2.py3-none-any.whl (67 kB)\nCollecting distro<2,>=1.5.0\n  Using cached https://www.piwheels.org/simple/distro/distro-1.5.0-py2.py3-none-any.whl (18 kB)\nCollecting jsonschema<4,>=2.5.1\n  Using cached https://www.piwheels.org/simple/jsonschema/jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)\nCollecting docker[ssh]>=5\n  Using cached https://www.piwheels.org/simple/docker/docker-5.0.0-py2.py3-none-any.whl (146 kB)\nCollecting texttable<2,>=0.9.0\n  Using cached https://www.piwheels.org/simple/texttable/texttable-1.6.3-py2.py3-none-any.whl (10 kB)\nCollecting python-dotenv<1,>=0.13.0\n  Using cached https://www.piwheels.org/simple/python-dotenv/python_dotenv-0.18.0-py2.py3-none-any.whl (18 kB)\nCollecting requests<3,>=2.20.0\n  Using cached https://www.piwheels.org/simple/requests/requests-2.25.1-py2.py3-none-any.whl (61 kB)\nCollecting PyYAML<6,>=3.10\n  Using cached PyYAML-5.4.1-cp38-cp38-linux_armv7l.whl\nCollecting docopt<1,>=0.6.1\n  Using cached https://www.piwheels.org/simple/docopt/docopt-0.6.2-py2.py3-none-any.whl (13 kB)\nCollecting dockerpty<1,>=0.4.1\n  Using cached https://www.piwheels.org/simple/dockerpty/dockerpty-0.4.1-py3-none-any.whl (16 kB)\nCollecting paramiko>=2.4.2\n  Using cached https://www.piwheels.org/simple/paramiko/paramiko-2.7.2-py2.py3-none-any.whl (206 kB)\nRequirement already satisfied: six>=1.3.0 in /usr/local/lib/python3.8/site-packages (from dockerpty<1,>=0.4.1->docker-compose) (1.15.0)\nCollecting attrs>=17.4.0\n  Using cached https://www.piwheels.org/simple/attrs/attrs-21.2.0-py2.py3-none-any.whl (53 kB)\nCollecting pyrsistent>=0.14.0\n  Using cached pyrsistent-0.18.0-cp38-cp38-linux_armv7l.whl\nRequirement already satisfied: setuptools in /usr/local/lib/python3.8/site-packages (from jsonschema<4,>=2.5.1->docker-compose) (49.2.1)\nCollecting cryptography>=2.5\n  Using cached cryptography-3.4.7.tar.gz (546 kB)\n  Installing build dependencies: started\n  Installing build dependencies: finished with status 'done'\n  Getting requirements to build wheel: started\n  Getting requirements to build wheel: finished with status 'done'\n    Preparing wheel metadata: started\n    Preparing wheel metadata: finished with status 'done'\nCollecting bcrypt>=3.1.3\n  Using cached bcrypt-3.2.0-cp38-cp38-linux_armv7l.whl\nCollecting pynacl>=1.0.1\n  Using cached PyNaCl-1.4.0-cp38-cp38-linux_armv7l.whl\nCollecting cffi>=1.1\n  Using cached cffi-1.14.5.tar.gz (475 kB)\nCollecting pycparser\n  Using cached https://www.piwheels.org/simple/pycparser/pycparser-2.20-py2.py3-none-any.whl (112 kB)\nCollecting chardet<5,>=3.0.2\n  Using cached https://www.piwheels.org/simple/chardet/chardet-4.0.0-py2.py3-none-any.whl (178 kB)\nCollecting urllib3<1.27,>=1.21.1\n  Using cached https://www.piwheels.org/simple/urllib3/urllib3-1.26.6-py2.py3-none-any.whl (138 kB)\nCollecting idna<3,>=2.5\n  Using cached https://www.piwheels.org/simple/idna/idna-2.10-py2.py3-none-any.whl (58 kB)\nCollecting certifi>=2017.4.17\n  Using cached https://www.piwheels.org/simple/certifi/certifi-2021.5.30-py2.py3-none-any.whl (145 kB)\nUsing legacy 'setup.py install' for cffi, since package 'wheel' is not installed.\nBuilding wheels for collected packages: cryptography\n  Building wheel for cryptography (PEP 517): started\n  Building wheel for cryptography (PEP 517): finished with status 'error'\nFailed to build cryptography\n\n:stderr:   ERROR: Command errored out with exit status 1:\n   command: /usr/local/bin/python3.8 /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpjs7ut37j\n       cwd: /tmp/pip-install-pk4zqt_6/cryptography_66682cd810dc4366bdb99d7de197d4da\n  Complete output (165 lines):\n  running bdist_wheel\n  running build\n  running build_py\n  creating build\n  creating build/lib.linux-armv7l-3.8\n  creating build/lib.linux-armv7l-3.8/cryptography\n  copying src/cryptography/fernet.py -> build/lib.linux-armv7l-3.8/cryptography\n  copying src/cryptography/__about__.py -> build/lib.linux-armv7l-3.8/cryptography\n  copying src/cryptography/utils.py -> build/lib.linux-armv7l-3.8/cryptography\n  copying src/cryptography/exceptions.py -> build/lib.linux-armv7l-3.8/cryptography\n  copying src/cryptography/__init__.py -> build/lib.linux-armv7l-3.8/cryptography\n  creating build/lib.linux-armv7l-3.8/cryptography/x509\n  copying src/cryptography/x509/general_name.py -> build/lib.linux-armv7l-3.8/cryptography/x509\n  copying src/cryptography/x509/ocsp.py -> build/lib.linux-armv7l-3.8/cryptography/x509\n  copying src/cryptography/x509/certificate_transparency.py -> build/lib.linux-armv7l-3.8/cryptography/x509\n  copying src/cryptography/x509/base.py -> build/lib.linux-armv7l-3.8/cryptography/x509\n  copying src/cryptography/x509/extensions.py -> build/lib.linux-armv7l-3.8/cryptography/x509\n  copying src/cryptography/x509/oid.py -> build/lib.linux-armv7l-3.8/cryptography/x509\n  copying src/cryptography/x509/name.py -> build/lib.linux-armv7l-3.8/cryptography/x509\n  copying src/cryptography/x509/__init__.py -> build/lib.linux-armv7l-3.8/cryptography/x509\n  creating build/lib.linux-armv7l-3.8/cryptography/hazmat\n  copying src/cryptography/hazmat/_types.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat\n  copying src/cryptography/hazmat/_der.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat\n  copying src/cryptography/hazmat/_oid.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat\n  copying src/cryptography/hazmat/__init__.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat\n  creating build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives\n  copying src/cryptography/hazmat/primitives/hashes.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives\n  copying src/cryptography/hazmat/primitives/_asymmetric.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives\n  copying src/cryptography/hazmat/primitives/hmac.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives\n  copying src/cryptography/hazmat/primitives/poly1305.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives\n  copying src/cryptography/hazmat/primitives/_cipheralgorithm.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives\n  copying src/cryptography/hazmat/primitives/constant_time.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives\n  copying src/cryptography/hazmat/primitives/cmac.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives\n  copying src/cryptography/hazmat/primitives/padding.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives\n  copying src/cryptography/hazmat/primitives/__init__.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives\n  copying src/cryptography/hazmat/primitives/_serialization.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives\n  copying src/cryptography/hazmat/primitives/keywrap.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives\n  creating build/lib.linux-armv7l-3.8/cryptography/hazmat/backends\n  copying src/cryptography/hazmat/backends/interfaces.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends\n  copying src/cryptography/hazmat/backends/__init__.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends\n  creating build/lib.linux-armv7l-3.8/cryptography/hazmat/bindings\n  copying src/cryptography/hazmat/bindings/__init__.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/bindings\n  creating build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/serialization\n  copying src/cryptography/hazmat/primitives/serialization/pkcs7.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/serialization\n  copying src/cryptography/hazmat/primitives/serialization/base.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/serialization\n  copying src/cryptography/hazmat/primitives/serialization/pkcs12.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/serialization\n  copying src/cryptography/hazmat/primitives/serialization/ssh.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/serialization\n  copying src/cryptography/hazmat/primitives/serialization/__init__.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/serialization\n  creating build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/asymmetric\n  copying src/cryptography/hazmat/primitives/asymmetric/dsa.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/asymmetric\n  copying src/cryptography/hazmat/primitives/asymmetric/ec.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/asymmetric\n  copying src/cryptography/hazmat/primitives/asymmetric/ed25519.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/asymmetric\n  copying src/cryptography/hazmat/primitives/asymmetric/x448.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/asymmetric\n  copying src/cryptography/hazmat/primitives/asymmetric/utils.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/asymmetric\n  copying src/cryptography/hazmat/primitives/asymmetric/ed448.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/asymmetric\n  copying src/cryptography/hazmat/primitives/asymmetric/padding.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/asymmetric\n  copying src/cryptography/hazmat/primitives/asymmetric/dh.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/asymmetric\n  copying src/cryptography/hazmat/primitives/asymmetric/__init__.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/asymmetric\n  copying src/cryptography/hazmat/primitives/asymmetric/x25519.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/asymmetric\n  copying src/cryptography/hazmat/primitives/asymmetric/rsa.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/asymmetric\n  creating build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/twofactor\n  copying src/cryptography/hazmat/primitives/twofactor/totp.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/twofactor\n  copying src/cryptography/hazmat/primitives/twofactor/utils.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/twofactor\n  copying src/cryptography/hazmat/primitives/twofactor/__init__.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/twofactor\n  copying src/cryptography/hazmat/primitives/twofactor/hotp.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/twofactor\n  creating build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/kdf\n  copying src/cryptography/hazmat/primitives/kdf/x963kdf.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/kdf\n  copying src/cryptography/hazmat/primitives/kdf/scrypt.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/kdf\n  copying src/cryptography/hazmat/primitives/kdf/hkdf.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/kdf\n  copying src/cryptography/hazmat/primitives/kdf/kbkdf.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/kdf\n  copying src/cryptography/hazmat/primitives/kdf/pbkdf2.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/kdf\n  copying src/cryptography/hazmat/primitives/kdf/__init__.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/kdf\n  copying src/cryptography/hazmat/primitives/kdf/concatkdf.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/kdf\n  creating build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/ciphers\n  copying src/cryptography/hazmat/primitives/ciphers/base.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/ciphers\n  copying src/cryptography/hazmat/primitives/ciphers/aead.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/ciphers\n  copying src/cryptography/hazmat/primitives/ciphers/algorithms.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/ciphers\n  copying src/cryptography/hazmat/primitives/ciphers/__init__.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/ciphers\n  copying src/cryptography/hazmat/primitives/ciphers/modes.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/primitives/ciphers\n  creating build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/ocsp.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/hashes.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/backend.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/dsa.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/ciphers.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/hmac.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/poly1305.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/ec.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/ed25519.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/encode_asn1.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/x448.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/utils.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/aead.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/cmac.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/ed448.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/dh.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/__init__.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/x25519.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/decode_asn1.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/rsa.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  copying src/cryptography/hazmat/backends/openssl/x509.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/backends/openssl\n  creating build/lib.linux-armv7l-3.8/cryptography/hazmat/bindings/openssl\n  copying src/cryptography/hazmat/bindings/openssl/_conditional.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/bindings/openssl\n  copying src/cryptography/hazmat/bindings/openssl/binding.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/bindings/openssl\n  copying src/cryptography/hazmat/bindings/openssl/__init__.py -> build/lib.linux-armv7l-3.8/cryptography/hazmat/bindings/openssl\n  running egg_info\n  writing src/cryptography.egg-info/PKG-INFO\n  writing dependency_links to src/cryptography.egg-info/dependency_links.txt\n  writing requirements to src/cryptography.egg-info/requires.txt\n  writing top-level names to src/cryptography.egg-info/top_level.txt\n  reading manifest file 'src/cryptography.egg-info/SOURCES.txt'\n  reading manifest template 'MANIFEST.in'\n  no previously-included directories found matching 'docs/_build'\n  warning: no previously-included files found matching 'vectors'\n  warning: no previously-included files matching '*' found under directory 'vectors'\n  warning: no previously-included files matching '*' found under directory '.github'\n  warning: no previously-included files found matching 'release.py'\n  warning: no previously-included files found matching '.coveragerc'\n  warning: no previously-included files found matching 'codecov.yml'\n  warning: no previously-included files found matching '.readthedocs.yml'\n  warning: no previously-included files found matching 'dev-requirements.txt'\n  warning: no previously-included files found matching 'tox.ini'\n  warning: no previously-included files found matching 'mypy.ini'\n  warning: no previously-included files matching '*' found under directory '.zuul.d'\n  warning: no previously-included files matching '*' found under directory '.zuul.playbooks'\n  adding license file 'LICENSE.BSD'\n  adding license file 'LICENSE'\n  adding license file 'LICENSE.PSF'\n  adding license file 'LICENSE.APACHE'\n  writing manifest file 'src/cryptography.egg-info/SOURCES.txt'\n  copying src/cryptography/py.typed -> build/lib.linux-armv7l-3.8/cryptography\n  running build_ext\n  generating cffi module 'build/temp.linux-armv7l-3.8/_padding.c'\n  creating build/temp.linux-armv7l-3.8\n  generating cffi module 'build/temp.linux-armv7l-3.8/_openssl.c'\n  running build_rust\n  \n      =============================DEBUG ASSISTANCE=============================\n      If you are seeing a compilation error please try the following steps to\n      successfully install cryptography:\n      1) Upgrade to the latest pip and try again. This will fix errors for most\n         users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip\n      2) Read https://cryptography.io/en/latest/installation.html for specific\n         instructions for your platform.\n      3) Check our frequently asked questions for more information:\n         https://cryptography.io/en/latest/faq.html\n      4) Ensure you have a recent Rust toolchain installed:\n         https://cryptography.io/en/latest/installation.html#rust\n      5) If you are experiencing issues with Rust for *this release only* you may\n         set the environment variable `CRYPTOGRAPHY_DONT_BUILD_RUST=1`.\n      =============================DEBUG ASSISTANCE=============================\n  \n  error: can't find Rust compiler\n  \n  If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.\n  \n  To update pip, run:\n  \n      pip install --upgrade pip\n  \n  and then retry package installation.\n  \n  If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.\n  \n  This package requires Rust >=1.41.0.\n  ----------------------------------------\n  ERROR: Failed building wheel for cryptography\nERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly\n"}

what we can do?

geerlingguy commented 3 years ago

@Hat3 - Please try installing on a Python 3 version: https://github.com/geerlingguy/internet-pi/issues/77#issuecomment-869785373 — and if you get that message also try upgrading pip following the command it shows: pip install --upgrade pip

Hat3 commented 3 years ago

i have fixed like this: echo cryptography==3.1.1 > requirements.txt pip install -r requirements.txt

but die in another step: TASK [Ensure internet-monitoring environment is running.] ******************************************************************************************************************************************************************** fatal: [127.0.0.1]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (Docker SDK for Python: docker above 5.0.0 (Python >= 3.6) or docker before 5.0.0 (Python 2.7) or docker-py (Python 2.6)) on rasp-server's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter, for example viapip install docker(Python >= 3.6) orpip install docker==4.4.4(Python 2.7) orpip install docker-py(Python 2.6). The error was: No module named 'docker'"}

benjackson1111 commented 3 years ago

I have this same error now. don't get why docker isn't installed or it can't find it.

benjackson1111 commented 3 years ago

Ok I'm making progress. I fixed the above error by manually copying docker from the .local in home/pi over to /usr/lib/python3/dist-packages. Then I got the same error but 'no module name websocket'. So then I manually copied over websocket as well.

Now I have this error:

fatal: [127.0.0.1]: FAILED! => {"changed": false, "msg": "Error connecting: Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied'))"}

for which i think i just need to reboot

Anyway, hope this helps someone else.

benjackson1111 commented 3 years ago

nope. now i have this error

fatal: [127.0.0.1]: FAILED! => {"changed": false, "msg": "Unable to load docker-compose. Try pip install docker-compose. Error: Traceback (most recent call last):\n File \"/tmp/ansible_community.docker.docker_compose_payload_t2bj0jj8/ansible_community.docker.docker_compose_payload.zip/ansible_collections/community/docker/plugins/modules/docker_compose.py\", line 483, in \nModuleNotFoundError: No module named 'compose'\n"}

benjackson1111 commented 3 years ago

so i've gone round and round in circles trying to solve this. the above error is no longer relevant. I've reinstalled python 3 and uninstalled everything a million times. I'm stuck at ansible-galaxy collection install -r requirements.yml

i now get the error: /usr/bin/env: ‘python’: No such file or directory

This is so general that I can't remember/figure out how to fix it.

have also tried ansible-galaxy collection install -r requirements.yml -e 'ansible_python_interpreter=/usr/bin/python' to try to send it to different pythons.

still gives the same error

b-fraley commented 3 years ago

@benjackson1111 any idea what you did that resolved my initial and persistent issue? Still struggling to find a root cause :(

benjackson1111 commented 3 years ago

@benjackson1111 any idea what you did that resolved my initial and persistent issue? Still struggling to find a root cause :(

I copied in the files it was asking for to the python install it’s using. But I think this method is a dead end as I still couldn’t get it to work. I think it’s to do with it not using the python u think it is. There’s a way to specify the python interpreter but even then no matter what I do it gives constant errors similar to your one. I managed to reinstall everything and get away from those errors but now I have the simple python error: /usr/bin/env: ‘python’: No such file or directory Which I can’t find a solution to

benjackson1111 commented 3 years ago

So basically copy in docker and web socket from where it got installed to the other python directories u might have. It was a trial and error process.

benjackson1111 commented 3 years ago

fixed python not found, just a bash issue i think, after multiple attempts at reinstalling python3 in different ways.

next error is this:

fatal: [127.0.0.1]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"ansible.legacy.setup": {"ansible_facts": {"discovered_interpreter_python": "/usr/local/bin/python3.9"}, "cmd": "/usr/bin/lsb_release -a", "failed": true, "invocation": {"module_args": {"fact_path": "/etc/ansible/facts.d", "filter": [], "gather_subset": ["all"], "gather_timeout": 10}}, "msg": "[Errno 2] No such file or directory: b'/usr/bin/lsb_release'", "rc": 2, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": [], "warnings": ["Platform linux on host 127.0.0.1 is using the discovered Python interpreter at /usr/local/bin/python3.9, but future installation of another Python interpreter could change the meaning of that path. See https://docs.ansible.com/ansible/2.11/reference_appendices/interpreter_discovery.html for more information."]}}, "msg": "The following modules failed to execute: ansible.legacy.setup\n"}

benjackson1111 commented 3 years ago

now my python seems to be behaving, i went back to the instructions above, to uninstall. it actually uninstalled and reinstalled without error or weirdness for first time. now i have this error when running ansible-galaxy command:

-bash: /home/pi/.local/bin/ansible-galaxy: No such file or directory

and yes, in that directory there's nothing. I'm not sure why ansible has correctly installed but not installed where the script expects. i'll keep investigating.

benjackson1111 commented 3 years ago

added this export PATH=$PATH:/home/pi/ansible/bin which stopped it complaining about ansible...but now the error is back to /usr/bin/env: ‘python’: No such file or directory

which i just don't get. if i type python or python3 it goes into the python shell thing. python -V shows "Python 3.9.5"

why can't ansible find python?

benjackson1111 commented 3 years ago

duplicated python3 in /usr/local/bin to python and that fixed the error, but on ansible-playbook main.yml command i'm back to:

fatal: [127.0.0.1]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"ansible.legacy.setup": {"ansible_facts": {"discovered_interpreter_python": "/usr/local/bin/python3.9"}, "cmd": "/usr/bin/lsb_release -a", "failed": true, "invocation": {"module_args": {"fact_path": "/etc/ansible/facts.d", "filter": [], "gather_subset": ["all"], "gather_timeout": 10}}, "msg": "[Errno 2] No such file or directory: b'/usr/bin/lsb_release'", "rc": 2, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": [], "warnings": ["Platform linux on host 127.0.0.1 is using the discovered Python interpreter at /usr/local/bin/python3.9, but future installation of another Python interpreter could change the meaning of that path. See https://docs.ansible.com/ansible/2.11/reference_appendices/interpreter_discovery.html for more information."]}}, "msg": "The following modules failed to execute: ansible.legacy.setup\n"}

benjackson1111 commented 3 years ago

man this is a torturorous experience

I followed this to relink python and python3 to the proper dir

https://stackoverflow.com/questions/58395566/lsb-release-command-not-found-in-latest-ubuntu-docker-container

Now I have a long nasty error I cannot fathom how to troubleshoot

TASK [Install Docker Compose using Pip.] *********************************************************** fatal: [127.0.0.1]: FAILED! => {"changed": false, "cmd": ["/usr/local/bin/pip3", "install", "docker-compose"], "msg": "\n:stderr: ERROR: Exception:\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.9/site-packages/pip/_internal/cli/base_command.py\", line 180, in _main\n status = self.run(options, args)\n File \"/usr/local/lib/python3.9/site-packages/pip/_internal/cli/req_command.py\", line 205, in wrapper\n return func(self, options, args)\n File \"/usr/local/lib/python3.9/site-packages/pip/_internal/commands/install.py\", line 269, in run\n session = self.get_default_session(options)\n File \"/usr/local/lib/python3.9/site-packages/pip/_internal/cli/req_command.py\", line 77, in get_default_session\n self._session = self.enter_context(self._build_session(options))\n File \"/usr/local/lib/python3.9/site-packages/pip/_internal/cli/req_command.py\", line 87, in _build_session\n session = PipSession(\n File \"/usr/local/lib/python3.9/site-packages/pip/_internal/network/session.py\", line 275, in __init__\n self.headers[\"User-Agent\"] = user_agent()\n File \"/usr/local/lib/python3.9/site-packages/pip/_internal/network/session.py\", line 132, in user_agent\n linux_distribution = distro.linux_distribution() # type: ignore\n File \"/usr/local/lib/python3.9/site-packages/pip/_vendor/distro.py\", line 125, in linux_distribution\n return _distro.linux_distribution(full_distribution_name)\n File \"/usr/local/lib/python3.9/site-packages/pip/_vendor/distro.py\", line 681, in linux_distribution\n self.version(),\n File \"/usr/local/lib/python3.9/site-packages/pip/_vendor/distro.py\", line 741, in version\n self.lsb_release_attr('release'),\n File \"/usr/local/lib/python3.9/site-packages/pip/_vendor/distro.py\", line 903, in lsb_release_attr\n return self._lsb_release_info.get(attribute, '')\n File \"/usr/local/lib/python3.9/site-packages/pip/_vendor/distro.py\", line 556, in __get__\n ret = obj.__dict__[self._fname] = self._f(obj)\n File \"/usr/local/lib/python3.9/site-packages/pip/_vendor/distro.py\", line 1014, in _lsb_release_info\n stdout = subprocess.check_output(cmd, stderr=devnull)\n File \"/usr/local/lib/python3.9/subprocess.py\", line 424, in check_output\n return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,\n File \"/usr/local/lib/python3.9/subprocess.py\", line 528, in run\n raise CalledProcessError(retcode, process.args,\nsubprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1.\nTraceback (most recent call last):\n File \"/usr/local/bin/pip3\", line 8, in <module>\n sys.exit(main())\n File \"/usr/local/lib/python3.9/site-packages/pip/_internal/cli/main.py\", line 71, in main\n return command.main(cmd_args)\n File \"/usr/local/lib/python3.9/site-packages/pip/_internal/cli/base_command.py\", line 104, in main\n return self._main(args)\n File \"/usr/local/lib/python3.9/site-packages/pip/_internal/cli/base_command.py\", line 221, in _main\n self.handle_pip_version_check(options)\n File \"/usr/local/lib/python3.9/site-packages/pip/_internal/cli/req_command.py\", line 143, in handle_pip_version_check\n session = self._build_session(\n File \"/usr/local/lib/python3.9/site-packages/pip/_internal/cli/req_command.py\", line 87, in _build_session\n session = PipSession(\n File \"/usr/local/lib/python3.9/site-packages/pip/_internal/network/session.py\", line 275, in __init__\n self.headers[\"User-Agent\"] = user_agent()\n File \"/usr/local/lib/python3.9/site-packages/pip/_internal/network/session.py\", line 132, in user_agent\n linux_distribution = distro.linux_distribution() # type: ignore\n File \"/usr/local/lib/python3.9/site-packages/pip/_vendor/distro.py\", line 125, in linux_distribution\n return _distro.linux_distribution(full_distribution_name)\n File \"/usr/local/lib/python3.9/site-packages/pip/_vendor/distro.py\", line 681, in linux_distribution\n self.version(),\n File \"/usr/local/lib/python3.9/site-packages/pip/_vendor/distro.py\", line 741, in version\n self.lsb_release_attr('release'),\n File \"/usr/local/lib/python3.9/site-packages/pip/_vendor/distro.py\", line 903, in lsb_release_attr\n return self._lsb_release_info.get(attribute, '')\n File \"/usr/local/lib/python3.9/site-packages/pip/_vendor/distro.py\", line 556, in __get__\n ret = obj.__dict__[self._fname] = self._f(obj)\n File \"/usr/local/lib/python3.9/site-packages/pip/_vendor/distro.py\", line 1014, in _lsb_release_info\n stdout = subprocess.check_output(cmd, stderr=devnull)\n File \"/usr/local/lib/python3.9/subprocess.py\", line 424, in check_output\n return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,\n File \"/usr/local/lib/python3.9/subprocess.py\", line 528, in run\n raise CalledProcessError(retcode, process.args,\nsubprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1.\n"}

benjackson1111 commented 3 years ago

so then if you look in the lsb_release file in /usr/bin you can see at the top there's the first line that references a python install. If you mess around with that and point it to your python3.9 then it will get past this. That'll get the process going, but then it'll fail again at docker-compose. So i'm really back where I started after another whole day of trying

fatal: [127.0.0.1]: FAILED! => { "changed": false, "cmd": [ "/usr/local/bin/pip3", "install", "docker-compose" ], "invocation": { "module_args": { "chdir": null, "editable": false, "executable": "pip3", "extra_args": null, "name": [ "docker-compose" ],

Strangely, if I change the file to point to a non-existent python install, the playbook won't start but if you do it in the middle after it's gotten past the previous error, it won't stall at docker but ... wait for it....the same rust/crypto error all this started with. did the same echo crypto requirements as suggested above, but it didn't fix it this time.

None of this makes any sense to me. I have a good python install, everything is in place... i just don't get it.

The final error at the bottom of -vvv output is

Command '('lsb_release', '-a')' returned non-zero exit status 1.\n"

benjackson1111 commented 3 years ago

this is the most random, arbitrary troubleshoot i've done in the history of computing (as a kid who grew up in a computer store my parents owned, that's saying something).

So I had to change the version number in the requirements.txt to 2.8. Not 3.1.1. 2.8.

And I had to change the python in lsb_release to 3.7. Not 3. Not 3.9.

So got thru those errors, and much further than ever before. Got all the way to 'ensure pi-hole is running'.

The full traceback is: File "/tmp/ansible_community.docker.docker_compose_payload_icj0g5lx/ansible_community.docker.docker_compose_payload.zip/ansible_collections/community/docker/plugins/modules/docker_compose.py", line 797, in cmd_up File "/usr/local/lib/python3.9/site-packages/compose/project.py", line 705, in up raise ProjectError( fatal: [127.0.0.1]: FAILED! => { "changed": false, "errors": [], "invocation": { "module_args": { "api_version": "auto", "build": false, "ca_cert": null, "client_cert": null, "client_key": null, "debug": false, "definition": null, "dependencies": true, "docker_host": "unix://var/run/docker.sock", "files": null, "hostname_check": false, "nocache": false, "profiles": null, "project_name": null, "project_src": "/home/pi/pi-hole/", "pull": false, "recreate": "smart", "remove_images": null, "remove_orphans": false, "remove_volumes": false, "restarted": false, "scale": null, "services": null, "ssl_version": null, "state": "present", "stopped": false, "timeout": 10, "tls": false, "tls_hostname": null, "use_ssh_client": false, "validate_certs": false } }, "module_stderr": "Creating pihole ... \nHost is already in use by another container\nCreating pihole ... error\n", "module_stdout": "latest: Pulling from pihole/pihole\nDigest: sha256:d2f764c4531515a1b93d5a8d1d82272ddc961e580f19c84ed764e4fa863823b1\nStatus: Downloaded newer image for pihole/pihole:latest\n", "msg": "Error starting project Encountered errors while bringing up the project."

benjackson1111 commented 3 years ago

And there you go, the final problem was just on my end because I run aqualinkd for my pool control on port 80, so needed to change the docker-compose.yml file from 80:80 to 8080:80 and then connect on that port (don't make it 8080:8080, didn't work).

Hope this helps someone!

stale[bot] commented 2 years ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

stale[bot] commented 2 years ago

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.