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.

installing kernel from virtualenv (on macos) points to system binary

See original GitHub issue

Hi,

When installing ipykernel kernelspecs from inside virtualenv I’m expecting to have kernelspec.json to point to the binary of the virtualenv, however, I get the system binary.

This happens on macOS with python3 installed via homebrew. python 3.7.1, ipykernel 5.1.0.

Steps to reproduce:

python3 -m venv --system-site-packages ipykerneltest
source ./ipykerneltest/bin/activate
python3 -m ipykernel install --name ipykerneltest --user
head ~/Library/Jupyter/kernels/ipykerneltest/kernel.json

I’m getting:

{
 "argv": [
  "/usr/local/opt/python/bin/python3.7",
...

Am I doing it all wrong, or is it a bug somewhere?

Regards to the team!

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
alexgawrilowcommented, Mar 5, 2019

I had the same problem on Ubuntu. After installing the ipykernel inside the virtual environment, the python path was set to the standard python path (/usr/bin/python3). However, when I deactivated the virtual environment and reactivated it and installed another ipykernel in the virtual environment, the python path was set correctly to the path of the virtual environment.

0reactions
waiyip-aquabytecommented, Jan 13, 2020

@alexgawrilow’s workaround does it for me. I have never used the --system-site-packages option.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Install Virtual Environments in Jupyter Notebook on Mac
The Install command is used in IPython kernel to add the specified virtual environment to the kernels in Jupyter Notebook. It specifies the...
Read more >
Python Virtual Environment Setup on Mac OSX - Easiest Way
Python Virtual Environment Setup on Mac OSX using the venv module and using Homebrew for installing Python 3. This is a step by...
Read more >
virtual environment from Mac to Linux - python - Stack Overflow
Install virtualenv using pip. sudo pip3 install virtualenv. Create a virtual environment. virtualenv venv. You can use any name instead of venv ......
Read more >
Pipenv & Virtual Environments
While pip can install Python packages, Pipenv is recommended as it's a ... On Linux and macOS you can find the user base...
Read more >
Python Virtual Environments: A Primer
Linux + macOS. (venv) PS> python -m pip install ...
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