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

sys path different in notebook and terminal #4888

Open
ai559031 opened this issue Sep 15, 2019 · 1 comment
Open

sys path different in notebook and terminal #4888

ai559031 opened this issue Sep 15, 2019 · 1 comment

Comments

@ai559031
Copy link

It happens many times that I cannot import module in jupyter notebook while it works in my terminal, so I try to figure out what happened.

When I execute sys.executable in jupyter notebook and in the terminal, the results are different:

Screen Shot 2019-09-15 at 11 23 06 pm

Screen Shot 2019-09-15 at 11 22 57 pm

The paths are different, one is in python3 and another is in python...
I've tried:

/Users/shinyuwu/anaconda3/bin/python -m pip install ipykernel
/Users/shinyuwu/anaconda3/bin/python -m  ipykernel install

But still not work for me :(
Can anyone help me

@jpmurillo
Copy link

I had the same issue. I edited the kernel.json file from:

{
"argv": [
"C:\Users\jpm\AppData\Local\Continuum\anaconda3\python.exe",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"display_name": "Python 3",
"language": "python"
}

to:

{
"argv": [
"python3",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"display_name": "Python 3",
"language": "python"
}

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants