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.

Pipenv is not used for Jupyter notebooks, as well as root project path

See original GitHub issue

Issue Type: Bug

  1. create or open any Pipenv-based workspace (or project… i don’t know the terminology)
  2. create a Jupyter notebbok (*.ipynb), or use existing one.
  3. run something that requires installed libraries in the pipenv
  4. see exception that library is not installed.

also, assuming i’m in notebooks folder, i had to insert this snipped to sys.path. as long as VSCode is launching the notebook, it should prepend not only current directory to sys.path, but also the project root, which holds main python module path though jupyter hooks.

import os
sys.path.append(os.path.abspath('..'))

Extension version: 2021.1.502429796 VS Code version: Code 1.53.0 (8490d3dde47c57ba65ec40dd192d014fd2113496, 2021-02-03T16:01:04.046Z) OS version: Darwin x64 19.6.0

A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30211402
pythonvsdeb440:30248342
pythonvsded773:30248341
pythonvspyt600cf:30251589

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
nfxcommented, May 7, 2021

@joyceerhl it’s still not using the pipenv classpath, nope

1reaction
karrtikrcommented, Feb 17, 2021

No. We did support it earlier, but due to security reasons we cannot run pipenv without user consent, hence the support was removed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a way to use pipenv with Jupyter notebook?
In your project folder: pipenv install ipykernel pipenv shell. This will bring up a terminal in your virtualenv like this:
Read more >
Common Pipenv Errors - Towards Data Science
The virtual environment is stored globally with the name of the project's root directory plus the hash of the full path to the...
Read more >
Configure a Pipenv environment | PyCharm Documentation
Open any directory with your source files that contains the Pipenv file: select File | Open from the main menu and choose the...
Read more >
Set up your project - The Good Research Code Handbook
Therefore, one project = one paper = one folder = one git repository is a generally a ... If you don't use git...
Read more >
Pyenv and Pipenv (on MacOS) – Index - Wilson Mar
If no .python-version is specified in any folder, the global $(pyenv root)/version file. Modify the global file using the command:
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