[英]Accessing package in python virtual environment
I have a virtual environment in which I have installed 'geopandas'.我有一个安装了“geopandas”的虚拟环境。 When I do a pip list it lists this package as well.
当我做一个 pip list 时,它也会列出这个包。 But when I try to call it in my jupyter notebook via 'import geopandas' I get a ModuleNotFoundError.
但是当我尝试通过“导入 geopandas”在我的 jupyter 笔记本中调用它时,我得到了一个 ModuleNotFoundError。 Please help - I'm using windows machine
请帮忙 - 我正在使用 Windows 机器
You should check if your notebook is using the correct kernel (the correct virtualenv).您应该检查您的笔记本是否使用了正确的内核(正确的 virtualenv)。 If you are still in the kernel using your standard environment and
geopandas
is not installed, it is possible you get this error.如果您仍在使用标准环境的内核中并且未安装
geopandas
,则可能会出现此错误。
So check if you are working in the correct kernel: kernel check所以检查你是否在正确的内核中工作:内核检查
You can install a kernel in jupyter notebook by activating the venv and then installing it:您可以通过激活 venv 然后在 jupyter notebook 中安装内核:
source activate myenv
python -m ipykernel install --user --name myenv --display-name "Python (myenv)"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.