I am trying to run a python script inside another one. Therefore, I want to activate the second virtual environment by calling its python executable. In fact, I want to call:
/home/mmoradi2/.local/share/virtualenvs/myproject-d4CrnaVY/bin/python3 second_tool.py -t table1 .....
In order to find the correct python executable, first I activated the virtual environment of the second tool by pipenv shell. Then, I did it:
$python3
import sys
sys.executable
And the result is like this:
'/home/mmoradi2/.local/share/virtualenvs/myproject-d4CrnaVY/bin/python3'
Then, I went to that directory by:
$cd /home/mmoradi2/.local/share/virtualenvs/myproject-d4CrnaVY/bin
Then, I run python by "python3".
This way, when I try to import the packages of the project, it does not recongnize them!!
when I activate the virtual environment by pipenv shell then I call python3, it recongnize those packages. But when I call python executable from the directory of virtual environment it does not recognize them. What should I do?