Home > Net >  What does it mean an installed application must be "visible" to a directory in linux?
What does it mean an installed application must be "visible" to a directory in linux?

Time:11-13

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 

CodePudding user response:

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.

CodePudding user response:

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.

  • Related