Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Is auto-import supposed to work with 3rd party packages?#355

rodrigoscc started this conversation inGeneral
Discussion options

I have rope auto-import enabled and it works for built-in functions and classes. For instance, if I typeip_ad, theipaddress.ip_address function will be listed in the completion popup, and if I pick it, it will be automatically imported. However, if I typeMethodView, I don't seeflask.views.MethodView listed in the completion popup.

I made sure to activate the virtual environment with Flask installed before opening Neovim. So my question is, is this expected behavior or is there something wrong with my setup? Thanks.

Pylsp version: 1.7.1
Neovim: 0.8.3

You must be logged in to vote

Replies: 3 comments 3 replies

Comment options

Alright, I figured it out. I forgot to update thepython_path rope setting.

For those interested, I added this to my project.ropeproject/config.py file:

def set_prefs(prefs):    prefs.add('python_path', '/Users/rodrigo/python-project/venv/lib/python3.9/site-packages/')
You must be logged in to vote
0 replies
Comment options

@rstcruzo, thanks for mentioning a solution!

@bagel897, is there something we could about this on pylsp directly?

You must be logged in to vote
0 replies
Comment options

Pylsp would need to run in the same virtual environment/be installed there. Otherwise you can pass the environment as a parameter to initialize the rope project in workspace.py

You must be logged in to vote
3 replies
@ccordoba12
Comment options

Otherwise you can pass the environment as a parameter to initialize the rope project in workspace.py

Yeah, that's what I was thinking. Users could send a didChangeConfiguration to set their current interpreter for the Rope project we use for refactorings.

@bagel897
Comment options

I would hold off on doing the didChangeConfiguration part untilthis issue and maybethis PR are resolved for speed/consistency reasons. Bit busy rn but shouldn't be too hard for someone to implement. First, I'd implement a general environment path for pylsp, possibly with PEP 582 support.

@fabio-pardo
Comment options

Has there been any update with this topic? I'm interested ☻

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
4 participants
@rodrigoscc@ccordoba12@fabio-pardo@bagel897

[8]ページ先頭

©2009-2025 Movatter.jp