question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support egg/zip files for IntelliSense

See original GitHub issue

Environment data

  • VS Code version: 1.27.1
  • Extension version (available under the Extensions sidebar): 2018.8.0
  • OS and version: OS X 10.13.6
  • Python version (& distribution if applicable, e.g. Anaconda): conda Python 3.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
  • Relevant/affected Python packages and their versions: torchvision (installed via conda install pytorch torchvision -c pytorch)

Expected behavior

Expect autocompletion in a buffer after

import torchvision
torchvision.

Actual behavior

Only generic suggestions with the ‘abc’ icon are listed.

It seems intellisense isn’t finding the torchvision package. It looks like torchvision configures itself via a .pth file:

~/anaconda3/lib/python3.6/site-packages $ cat torchvision.pth
./torchvision-0.2.1-py3.6.egg

which results in the following sys.path from a Python session (note the special entry for ‘torchvision-0.2.1-py3.6.egg’

In [1]: import sys

In [2]: sys.path
Out[2]:
['',
 '/Users/malmaud/anaconda3/bin',
 '/Users/malmaud/anaconda3/lib/python36.zip',
 '/Users/malmaud/anaconda3/lib/python3.6',
 '/Users/malmaud/anaconda3/lib/python3.6/lib-dynload',
 '/Users/malmaud/.local/lib/python3.6/site-packages',
 '/Users/malmaud/anaconda3/lib/python3.6/site-packages',
 '/Users/malmaud/anaconda3/lib/python3.6/site-packages/aeosa',
 '/Users/malmaud/anaconda3/lib/python3.6/site-packages/torchvision-0.2.1-py3.6.egg',
 '/Users/malmaud/anaconda3/lib/python3.6/site-packages/IPython/extensions',
 '/Users/malmaud/.ipython']

Perhaps VSCode isn’t accounting for the pth file modifying sys.path when it searches for torchvision?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
brettcannoncommented, Oct 4, 2018

I’ve verified it’s because of the .egg installation since it’s a zip file and the language server doesn’t support zip files yet. I’ve filed an issue upstream for it.

0reactions
MikhailArkhipovcommented, Sep 16, 2019

LS 0.4.17+

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get intellisense to work with a .egg-link package ...
Inside my ./env/Lib/site-packages folder, I can see that cryptofeed is an .egg-link file (more info on that here). Does Visual Studio handle ...
Read more >
Win Explorer AutoComplete completely haywire, can't rename ...
I keep going and type the "r" in "tree". Now the "t" disappears, the file name autocompletes to "ring" and the file type...
Read more >
ALZip - Free download and software reviews
The ALZip rovides its own file format "EGG", which makes better compression ratio and full Unicode support. Also, users can open 40 archive...
Read more >
Download localized .NET IntelliSense files - Microsoft
Download and install localized IntelliSense files for .NET and .NET Core to aid in code completion in Visual Studio.
Read more >
spyderlib - Google Code
2062, HelpNeeded, Consoles fail to reload packages if they are installed as egg (zip) files Type-Defect Priority-Low Cat-Console Restrict-AddIssueComment- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found