问题
I want to use tensorflow through a virtual environment. However, the Python script I want to run requires me to use a separate virtual environment that does not include tensorflow.
Is it possible to activate these simultaneously? If not, can I merge the two virtual environments somehow?
回答1:
Check this out.
You could also activate different virtual environments on different terminal sessions
回答2:
You could try adding the site-packages
dir of the other virtualenv to your PYTHONPATH variable. Your mileage may vary, but I think it would work for the majority of the packages.
export PYTHONPATH=<other-env>/lib/python3.6/site-packages:$PYTHONPATH
(or the equivalent variable setting statement for your OS/Shell)
来源:https://stackoverflow.com/questions/50953575/can-you-activate-multiple-python-virtual-environments-at-once