gpt4 book ai didi

python - 无法导入使用 PIP 安装的包

转载 作者:太空宇宙 更新时间:2023-11-04 02:31:56 37 4
gpt4 key购买 nike

问题

我不是编程新手,但我是 Python 新手。我正在尝试针对 Coinbase 的 GDAX 市场导入一个名为 GDAX 的包。我已经使用 pip install gdaxpython -m pip install gdax 按照我在网上找到的与我的问题类似的解决方案安装了它。

包在这两种情况下都已成功安装,但是,当我在 PyCharm 中创建新项目并尝试 import gdax 时,找不到它。我已经尝试了几种不同的关键字搜索来为我的问题找到解决方案,但还没有找到。我已经搜索了关于如何安装 python 中未包含的包的通用教程,看起来我为安装包所做的工作是正确的。

关于我做错了什么或遗漏了什么有什么建议吗?

最佳答案

解决方法:

启用 Inherit global site-packages 解决了我的问题

要在 PyCharm 中添加/编辑 Python 解释器,请转到:

File -> Settings -> Project: -> Project Interpreter

按下齿轮按钮并选择更多:

enter image description here

这显示了所有配置的解释器。从这里您可以添加/编辑虚拟环境。

If you want the site-packages of the base interpreter to be visible from the virtual environment, select the check box Inherit global site-packages. If you leave this check box cleared, the new virtual environment will be completely isolated.

( PyCharm Docs )

关于python - 无法导入使用 PIP 安装的包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48968668/

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