我使用 IPython 和%bookmarkmagic 命令,但限制是我需要退出 IPython shell 才能激活虚拟环境,然后重新启动 IPython。
有没有办法内置到 IPython、第三方包或已知的 hack 中,让我在不退出 IPython shell 的情况下激活环境?
# within ipython shell
exit
# bash shell
cd path/of/my/project
poetry shell # or pipenv shell
ipython
Run Code Online (Sandbox Code Playgroud)
%cd -b demographics
# activate venv
import package # from that env
Run Code Online (Sandbox Code Playgroud)