Closed montyz closed 3 years ago
Hi,
Did you apt-get install python3
before running this role? That's typically a requirement to run Ansible.
Also where are you running Ubuntu 20.04 on? Is it some cloud provider? Or the stock ISO straight from Ubuntu? Something else?
I did not install python3
, I will try that. It's from the ubuntu ISO.
I see that python3 had been already installed. After making sure it is installed, still got the same issue. I thought maybe it was using the legacy pip, but that doesn't seem to be the case:
monty@server0:~$ which pip
monty@server0:~$ which pip3
/usr/bin/pip3
I installed ansible according to https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-on-ubuntu :
$ sudo apt update
$ sudo apt install software-properties-common
$ sudo apt-add-repository --yes --update ppa:ansible/ansible
$ sudo apt install ansible
I'm not sure what I would run manually from the command line to see what's going wrong, especially since I would need to use the virtualenv.
Where are you running Ubuntu 20.04 on? Is it some cloud provider? Or the stock ISO straight from Ubuntu? Something else?
It's local, on a dell T110 II I'm setting up as a media server. Installed from the Ubuntu desktop 20.04 ISO
What's interesting is your error mentions a lack of setuptools
being installed but this role installs python3-setuptools
for you automatically.
Are you running Python 2.x?
Yeah it looks like python 2 is the default.
monty@server0:~$ python --version
Python 2.7.18
And yes, I saw python3-setuptools
is installed and the virtualenv is specified, though I noticed this piece of the debug output -- I don't know why the virtualenv_python
would be null.
"virtualenv": "/usr/local/lib/docker/virtualenv",
"virtualenv_command": "virtualenv",
"virtualenv_python": null,
"virtualenv_site_packages": false
Also noticing that that virtualenv dir is missing
monty@server0:~$ sudo ls /usr/local/lib/docker/
ls: cannot access '/usr/local/lib/docker/': No such file or directory
monty@server0:~$ sudo ls /usr/local/lib/
python2.7 python3.8
Ubuntu 20.04 LTS shouldn't have Python 2 installed based on the release notes:
In 20.04 LTS, the python included in the base system is Python 3.8. Python 2.7 has been moved to universe and is not included by default in any new installs.
How did your system end up with Python 2.x on it? Maybe it's because it's the desktop edition and not server? I'm not sure to be honest. I only ever ran this role on the server variant.
In any case I think there's maybe a few ways to address this:
In your inventory/group_vars/all.yml
file put ansible_python_interpreter: "/usr/bin/python3"
Change the "Install Python packages" task in tasks/main.yml
by adding this property to the pip module: virtualenv_python: "python3"
.
Let me know if the 2nd one works btw because I had just added that to this role this morning to potentially fix another issue and haven't pushed the change yet.
Just #2 wasn't sufficient, but those two together did fix this issue and I was able to install successfully. Thanks so much for your help!
I'm installing on a pretty new ubuntu 20.04 box and get this error.
My playbook just has
Here's a run with
-vvv
: install-failure.txt