这很好:
pipenv install
pipenv shell
pip freeze
我可以看到我的依赖已安装。
但是!然后我启动一个笔记本:
pipenv运行jupyter笔记本
从这里我无法再导入所有模块:
“没有名为...的模块”
我找到补救方法的唯一方法是将虚拟env添加到路径:
添加/Users/me/.virtualenvs/my-project-sSvqGt-H/lib/python3.7/site-packages /
// all paths before adding virtualenv
['/Users/me/Desktop/projects/this-project/maker/examples',
'/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python37.zip',
'/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7',
'/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload',
'',
'/Users/me/Library/Python/3.7/lib/python/site-packages',
'/usr/local/lib/python3.7/site-packages',
'/usr/local/lib/python3.7/site-packages/IPython/extensions',
'/Users/me/.ipython']
这是怎么回事?为什么在Pipenv中运行我的Notebook不能在没有其他路径的情况下访问virtualenv网站包?