Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipenv editable install not detected #4476

Closed
jcampbell opened this issue Jun 8, 2023 · 2 comments
Closed

pipenv editable install not detected #4476

jcampbell opened this issue Jun 8, 2023 · 2 comments
Assignees
Labels
user responded Was "waiting for user response" and they responded

Comments

@jcampbell
Copy link

I have an editable install of a python module in a virtual environment managed by pipenv. The package was installed directly from git.

The package is not recognized by pylance unless it is explicitly added to the python.analysis.extraPaths list, even though it is located in the src (vs the lib/.../site-packages) directory. It is included in site-packages.

Environment data

  • Language Server version: 2023.5.50
  • OS and version: darwin arm64
  • Python version (and distribution if applicable, e.g. Anaconda): 3.9.16
  • python.analysis.indexing: true
  • python.analysis.typeCheckingMode: basic

Code Snippet

2023-06-08 16 07 43

import great_expectations as gx # great_expectations has been installed directly from github using pipenv

Repro Steps

Install an editable module using pipenv:
pipenv install -e git+https://github.com/great-expectations/great_expectations.git@develop#egg=great-expectations

Expected behavior

Module is correctly analyzed.

Actual behavior

Module must be included in analysis.extraPaths

Logs

Here are what I think are the relevant logs...

2023-06-08 16:05:46.403 [info] [Info  - 4:05:46 PM] (88455)   Looking in extraPath '/Users/james/.local/share/virtualenvs/data-validation-3VeP54W-/src/great-expectations'
2023-06-08 16:05:46.403 [info] [Info  - 4:05:46 PM] (88455)   Attempting to resolve stub package using root path '/Users/james/.local/share/virtualenvs/data-validation-3VeP54W-/src/great-expectations'
2023-06-08 16:05:46.404 [info] [Info  - 4:05:46 PM] (88455)   Attempting to resolve using root path '/Users/james/.local/share/virtualenvs/data-validation-3VeP54W-/src/great-expectations'

Hard to know what are the right missing logs.

@debonte
Copy link
Contributor

debonte commented Jun 8, 2023

Please see our documentation on resolving imports from editable installs: https://microsoft.github.io/pyright/#/import-resolution?id=editable-installs

@heejaechang heejaechang removed their assignment Jun 8, 2023
@heejaechang heejaechang added the waiting for user response Requires more information from user label Jun 8, 2023
@heejaechang heejaechang self-assigned this Jun 8, 2023
@jcampbell
Copy link
Author

Thanks for pointing me to the docs--I was able to get it to work as expected by using a pip install instead of pipenv install; if it's an issue at all, then, it would seem to be with having pipenv allow that flag. Thank you!

@github-actions github-actions bot added user responded Was "waiting for user response" and they responded and removed waiting for user response Requires more information from user labels Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user responded Was "waiting for user response" and they responded
Projects
None yet
Development

No branches or pull requests

3 participants