Can't access packages of activated python environment
My code doesn't run without the #!/usr/bin/python
shebang, it throws error
import: command not found
.
But I want to run it for other conda
environment. When I run the code doesn't matter which conda
env I activate it still fetches the system python's old packages e.g. opencv 2.4.8
whereas I want to use 4.0.0
I understand it probably because of that shebang, but is there any way to use other python envs as a default interpreter? Is it possible to use ros with distinct conda/python environment?
Wouldn't the correct shebang be:
#!/usr/bin/env python
? That should pick up whatever the system considers the default Python interpreter.Possible? Yes. Straightforward? No. You're going to have to install all Python pkgs in each Python env, unless you want to manually change the
PYTHONPATH
in each.