如图,从 flask 导入的包都可以完成补全:
但 flask_sqlalchemy 的部分代码无法补全:
贴一下 init.el 里的配置:
(defun dotspacemacs/user-config ()
;; python configurations:
(require 'pyvenv)
(add-to-list 'company-backends 'company-anaconda)
(add-to-list 'company-backends 'company-jedi)
(add-to-list 'company-backends 'company-web)
(add-hook 'python-mode-hook 'anaconda-mode)
(add-hook 'python-mode-hook (lambda () (pyvenv-activate (concat (projectile-project-root) "/venv"))))
(setq web-mode-engines-alist
'(("django" . "\\.html\\'")))
(setq tab-width 4)
(setq py-indent-offset 4)
(setq python-spacemacs-indent-guess nil)
(setq python-indent-guess-indent-offset nil)
(setq org-confirm-babel-evaluate nil)
)
然后是 pip list:
Package Version
---------------- -------
alembic 1.0.11
argh 0.26.2
Click 7.0
Flask 1.1.0
Flask-CKEditor 0.4.3
Flask-Migrate 2.5.2
Flask-SQLAlchemy 2.4.0
Flask-WTF 0.14.2
itsdangerous 1.1.0
jedi 0.14.0
Jinja2 2.10.1
Mako 1.0.13
MarkupSafe 1.1.1
parso 0.5.0
pathtools 0.1.2
pip 19.1.1
python-dateutil 2.8.0
python-dotenv 0.10.3
python-editor 1.0.4
PyYAML 5.1.1
setuptools 39.0.1
six 1.12.0
SQLAlchemy 1.3.5
watchdog 0.9.0
Werkzeug 0.15.4
WTForms 2.2.1