Install airflow package extras in PyCharm

佐手、 提交于 2019-12-05 01:30:26

问题


I want to use Airflow package extras s3 and postgres in PyCharm but do not know how to install them (on macOS Sierra).

My attempts so far

Airflow itself can be installed from Preferences > Project > Project interpreter > + but not the extras as far as I can work out. The extras can be installed with pip in the terminal using

$ pip install airflow[s3,postgres]

but they end up in a different interpreter (~/anaconda) than the one used by PyCharm (/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7).

Checking the Python executables in my /usr/local/bin directory I found that only pip3 and pip3.5 point to the PyCharm interpreter, but pip, pip2, pip2.7 do not.

$ 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

Browsing the directory of the PyCharm interpreter I found all the expected python executables (python, python2.7 etc.) pointed to from /usr/local/bin but no pip.

What I need help with

So, the problem could be solved if I/you/we can figure out either

  1. how to install airflow[s3,postgres] from within PyCharm, or
  2. how to run pip install airflow[s3,postgres] pointing to the PyCharm interpreter.

回答1:


So, the problem could be solved if I/you/we can figure out either

  1. how to install airflow[s3,postgres] from within PyCharm, or

  2. how to run pip install airflow[s3,postgres] pointing to the PyCharm interpreter.

Or maybe?:

  1. Add the ~/anaconda Python to Pycharm

To add another python interpreter to Pycharm goto:

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

Press the Gear Button and select more:

This shows all of the interpreters configured. Select the + button, and select add local:

Now you should be able to add your anaconda Python to Pycharm. You can then select which Python to use as primary for the project, and you can select which Python to run under:

Run -> Edit Configurations


来源:https://stackoverflow.com/questions/41982661/install-airflow-package-extras-in-pycharm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!