gpt4 book ai didi

python - 模块安装成功,导入时找不到? - Python

转载 作者:行者123 更新时间:2023-12-03 21:39:30 26 4
gpt4 key购买 nike

我在尝试使用 graphviz Python 模块时遇到了这个问题:我在我的命令提示符下 pip 安装了它,但它没有出现在 IPython 中。我还有一个显示它的 Python 3.5(32 位)解释器,但我想弄清楚如何安装它以便它在 IPython 中工作。

有人建议我为每个解释器包含 sys.path。

有人对我如何更改它有任何想法吗?

enter image description here

最佳答案

尝试使用虚拟环境。

   $ virtualenv -p python3 `/path/to/venv/dir`
$ . `/path/to/venv/dir/bin/activate`
(venv) $ # indicates virtual env is configured
(venv) $ which pip python3
(venv) $ pip install whatever
(venv) $ python3 script.py

关于python - 模块安装成功,导入时找不到? - Python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47043711/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com