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

Jupyter Notebook to work with virtualenv which has libraries in it #8

Open
juhahu opened this issue Jan 14, 2019 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@juhahu
Copy link
Member

juhahu commented Jan 14, 2019

Adding libraries to Spark using virtualenvs doesn't work with Jupyter Notebook. Have to see how to make it work.

@juhahu juhahu added the bug Something isn't working label Jan 14, 2019
@juhahu juhahu self-assigned this Jan 14, 2019
@juhahu
Copy link
Member Author

juhahu commented Jan 17, 2019

Library included using Installing libraries with method 2. can be used also in Jupyter notebook when the new package is added to to sys.path.
Run these commands on notebook cell before importing new packages (assuming Python 3.6 is used):
import sys
sys.path.insert(0, '/mnt/\<cluster-name\>-pvc/scikit/lib/python3.6/site-packages/')

You can check if the path was added to first line of sys.path by running next command:
for p in sys.path: print(p)

After that, you can import new installed packages for example:
from spark_sklearn import GridSearchCV

Still need to figure out is there way to automate that to notebook initialization to remove need for user to add path for every notebook manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant