在 PyCharm 中安装 airflow 附加包
Install airflow package extras in PyCharm
我想在 PyCharm 中使用 Airflow package extras s3
和 postgres
但不知道如何安装它们(在 macOS Sierra 上)。
我目前的尝试
Airflow 本身可以从 Preferences > Project > Project interpreter > + 但就我所能计算的,没有额外的东西。
可以使用
在终端中使用 pip
安装附加功能
$ pip install airflow[s3,postgres]
但它们最终使用的解释器 (~/anaconda
) 与 PyCharm (/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7
) 使用的解释器不同。
检查我的 /usr/local/bin
目录中的 Python 可执行文件我发现只有 pip3
和 pip3.5
指向 PyCharm 解释器,但是 pip
, pip2
, pip2.7
不。
$ ls -la /usr/local/bin | grep pip
-rwxr-xr-x 1 root admin 204 Dec 21 11:41 pip
-rwxr-xr-x 1 root admin 204 Dec 21 11:41 pip2
-rwxr-xr-x 1 root admin 204 Dec 21 11:41 pip2.7
lrwxr-xr-x 1 christofer admin 34 Nov 21 11:53 pip3 -> ../Cellar/python3/3.5.2_3/bin/pip3
lrwxr-xr-x 1 christofer admin 36 Nov 21 11:53 pip3.5 -> ../Cellar/python3/3.5.2_3/bin/pip3.5
浏览 PyCharm 解释器的目录,我发现所有预期的 python 可执行文件(python
、python2.7
等)指向 /usr/local/bin
但没有 pip
.
我需要什么帮助
所以,如果I/you/we能想出其中一个问题就可以解决
- 如何从 PyCharm 或
中安装 airflow[s3,postgres]
- 如何 运行
pip install airflow[s3,postgres]
指向 PyCharm 解释器。
So, the problem could be solved if I/you/we can figure out either
how to install airflow[s3,postgres] from within PyCharm, or
how to run pip install airflow[s3,postgres] pointing to the PyCharm interpreter.
或者也许?:
- 将
~/anaconda
Python 添加到 Pycharm
要将另一个 python 解释器添加到 Pycharm 转到:
File -> Settings -> Project: -> Project Interpreter
按下齿轮按钮 select more
:
这显示了配置的所有解释器。 Select +
按钮,以及 select add local
:
现在您应该可以将 anaconda Python 添加到 Pycharm。然后,您可以 select 哪个 Python 用作项目的主要对象,并且您可以 select 哪个 Python 到 运行 下:
Run -> Edit Configurations
我想在 PyCharm 中使用 Airflow package extras s3
和 postgres
但不知道如何安装它们(在 macOS Sierra 上)。
我目前的尝试
Airflow 本身可以从 Preferences > Project > Project interpreter > + 但就我所能计算的,没有额外的东西。 可以使用
在终端中使用pip
安装附加功能
$ pip install airflow[s3,postgres]
但它们最终使用的解释器 (~/anaconda
) 与 PyCharm (/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7
) 使用的解释器不同。
检查我的 /usr/local/bin
目录中的 Python 可执行文件我发现只有 pip3
和 pip3.5
指向 PyCharm 解释器,但是 pip
, pip2
, pip2.7
不。
$ ls -la /usr/local/bin | grep pip
-rwxr-xr-x 1 root admin 204 Dec 21 11:41 pip
-rwxr-xr-x 1 root admin 204 Dec 21 11:41 pip2
-rwxr-xr-x 1 root admin 204 Dec 21 11:41 pip2.7
lrwxr-xr-x 1 christofer admin 34 Nov 21 11:53 pip3 -> ../Cellar/python3/3.5.2_3/bin/pip3
lrwxr-xr-x 1 christofer admin 36 Nov 21 11:53 pip3.5 -> ../Cellar/python3/3.5.2_3/bin/pip3.5
浏览 PyCharm 解释器的目录,我发现所有预期的 python 可执行文件(python
、python2.7
等)指向 /usr/local/bin
但没有 pip
.
我需要什么帮助
所以,如果I/you/we能想出其中一个问题就可以解决
- 如何从 PyCharm 或 中安装
- 如何 运行
pip install airflow[s3,postgres]
指向 PyCharm 解释器。
airflow[s3,postgres]
So, the problem could be solved if I/you/we can figure out either
how to install airflow[s3,postgres] from within PyCharm, or
how to run pip install airflow[s3,postgres] pointing to the PyCharm interpreter.
或者也许?:
- 将
~/anaconda
Python 添加到 Pycharm
要将另一个 python 解释器添加到 Pycharm 转到:
File -> Settings -> Project: -> Project Interpreter
按下齿轮按钮 select more
:
这显示了配置的所有解释器。 Select +
按钮,以及 select add local
:
现在您应该可以将 anaconda Python 添加到 Pycharm。然后,您可以 select 哪个 Python 用作项目的主要对象,并且您可以 select 哪个 Python 到 运行 下:
Run -> Edit Configurations