不能导入安装了PIP的包

时间:2023-01-05 20:24:41

Problem

问题

I'm not new to programming, however I am new to Python. I am attempting to import a package called GDAX in regards to Coinbase's GDAX market. I've installed it using pip install gdax, and python -m pip install gdax per solutions I have found online similar to my issue.

我对编程并不陌生,但是我对Python很陌生。我正试图进口一个名为GDAX的包装,以应对Coinbase的GDAX市场。我使用pip安装了gdax,而python -m pip安装了与我在网上找到的类似的gdax解决方案。

The package is installed successfully in both cases, however, when I create my new project in PyCharm, and try import gdax, it's not found. I've tried several different keyword searches to find a solution for my problem, but have yet to find one. I've searched for generic tutorials on how to install packages not included in python, and it seems like what I've done to install the package is correct.

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

Any suggestions as to what I'm doing wrong, or what I'm missing?

对于我做错了什么,或者我遗漏了什么,有什么建议吗?

1 个解决方案

#1


2  

Solution:

解决方案:

Enabling Inherit global site-packages has resolved my problem

启用继承全局站点包解决了我的问题

To add/edit a Python interpreter in PyCharm goto:

在PyCharm goto中添加/编辑Python解释器:

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

Press the Gear Button and select more:

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

不能导入安装了PIP的包

This shows all of the interpreters configured. From here you can add/edit the Virtual Enviroments.

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

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)

(PyCharm文档)

#1


2  

Solution:

解决方案:

Enabling Inherit global site-packages has resolved my problem

启用继承全局站点包解决了我的问题

To add/edit a Python interpreter in PyCharm goto:

在PyCharm goto中添加/编辑Python解释器:

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

Press the Gear Button and select more:

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

不能导入安装了PIP的包

This shows all of the interpreters configured. From here you can add/edit the Virtual Enviroments.

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

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)

(PyCharm文档)