Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CentOS 7 issues with "ImportError: No module named concurrent.futures" and "SyntaxError: Non-ASCII character '\xc3'" #6

Open
davidcallen opened this issue Jul 29, 2021 · 0 comments

Comments

@davidcallen
Copy link

Using role with tag 1.0.2

When I run the "aws" command I got error :

ImportError: No module named concurrent.futures

I did a "pip install futures" but now when I run the aws tool I get error :

SyntaxError: Non-ASCII character '\xc3' in file /usr/lib/python2.7/site-packages/rsa/key.py

I found that upgrading pip before installation helped.

Also I used pip3 as the pip_executable instead of just pip. I'm not 100% why this is necessary because the executable files /usr/local/bin/pip and /usr/local/bin/pip3 appear to both use python3 and are identical.

$ uname -a
Linux ta-core-docker-qa-mail.tradingapps.com 3.10.0-1160.36.2.el7.x86_64 #1 SMP Wed Jul 21 11:57:15 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

$ cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)

So my solution was :

diff --git a/defaults/main.yml b/defaults/main.yml
index ed97d53..19729dc 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -1 +1,2 @@
 ---
+pip_executable_override:
diff --git a/tasks/install-redhat-7.yml b/tasks/install-redhat-7.yml
index 25b49bf..54440a8 100644
--- a/tasks/install-redhat-7.yml
+++ b/tasks/install-redhat-7.yml
@@ -26,9 +26,13 @@
   tags:
     - install
 
+- name: "Upgrade pip"
+  shell: "{{ pip_executable_override | default('pip') }} install --upgrade pip"
+
 - name: Install {{ cli_package }}
   pip:
     name: "{{ cli_package }}"
     state: present
+    executable: "{{ pip_executable_override | default('pip') }}"
   tags:
     - install

and the role was used like this :

    #- role: christiangda.awscli  # Use my patched version instead as below...
    - role: ansible-role-awscli
      vars:
        pip_executable_override: pip3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant