0

I'm trying deploy openstack using Kolla-ansible approach with this guide using a virtual environment. while I write the command:

kolla-ansible -i ./all-in-one bootstrap-servers

I get this error:

TASK [openstack.kolla.packages : Install packages] *****************************************************
[WARNING]: Updating cache and auto-installing missing dependency: python3-apt
fatal: [localhost]: FAILED! => {"changed": false, "msg": "python3-apt must be installed and visible from /root/my_venv/bin/python."}

I googled but didn't find anything helpful and I'm super new to ansible, openstack and linux. What is the best course of action to take?

I expect the outcome to be something like this:

PLAY RECAP *********************************************************************************************
localhost: ok=8    changed=0    unreachable=0    **failed=0**   skipped=3    rescued=0    ignored=0 
Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
John
  • 35
  • 9

2 Answers2

1

A python package can be installed in a number of locations. Different virtual environments are configured to search different sets of such locations, so some of these virtual environments may be able to find a package and others may not.

A virtual environment created in the default way will not be able to find globally installed packages. This is by design.

Your specific virtual environment /root/my_venv/ must be able to find python3-apt. Even if it is installed globally, the virtual environment will not find it.

One way is to activate the virtual environment and pip3 install the package. It will be visible only to that virtual environment.

Another way is to install the package globally with say apt install, and then create your virtual environment to inherit global packages like this.

n. m. could be an AI
  • 112,515
  • 14
  • 128
  • 243
0

In Linux, an installed application must be "visible" to a directory in order for the user to be able to access it. This means that the application must be located in a directory that is listed in the user's PATH environment variable.

  • Thanks. so the environment variables can access the PATH? – John Nov 14 '22 at 06:12
  • The PATH environment variable is a list of directories that the shell will search for executable files when you type a command. If the command is not found in any of the directories listed in PATH, then the shell will print an error message. – ANISH SAJI KUMAR Nov 14 '22 at 06:16