1

I have recently created my own PyPI package with a bunch of useful functions. It works great, and when I import it in any project, the functions work, but my Visual Studio Code doesn't show the docstrings when I hover over the functions, and the functions stay white.

Are there Python Visual Studio Code settings I need to change or things I need to change in my PyPI package?

enter image description here

The GitHub place for jeffutils.

I have tried setting the "python.analysis.packageIndexDepths" depth for "jeffutils" to 4, and I added from .utils import * into the __init__.py file in the package.

Other than that, I am kind of lost, since Pylance and the Python interpreter will pop up docstrings for all of the other pip-installed packages I have.

4
  • 1
    Can't reproduce. Try using another machine (e.g. a GitHub codespace), then compare that with your current environment. Commented Jun 3, 2024 at 20:20
  • @InSync I appreciate that advice. In GitHub codespace, it pops up everything like normal. What things can I do to look at the codespace environment and compare it with mine? Commented Jun 4, 2024 at 14:46
  • 1
    Try turning on settings sync and start from there. Other than that, I have no idea. Commented Jun 4, 2024 at 14:50
  • 1
    @InSync Thanks for your help! Going through item by item and making sure Python and Pylance settings matched seemed to fix it! Commented Jun 4, 2024 at 15:05

1 Answer 1

1

Following InSync's advice, I compared my Pylance and Python extensions settings with the settings in GitHub Codespaces.

I made sure everything matched up the same. The things I recall changing was getting rid of my PythonAnalysis:Extra Paths (I had paths to a couple of Python binary files on my CPU), and then pip uninstalling and reinstalling the jeffutils package.

I wish I knew what fixed the problem, but following InSync's advice worked!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.