DonJayamanne / vscodeJupyter

Jupyter for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=donjayamanne.jupyter
MIT License
334 stars 34 forks source link

Importing personal modules #122

Open miguel199 opened 6 years ago

miguel199 commented 6 years ago

Environment data

VS Code version: 1.23.1 Jupyter Extension version: 1.1.4 OS and version: Windows 10 with Anaconda

Logs

Output from Jupyter output panel

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-2-dbd9d2b4a6f0> in <module>()
      1 # %%
      2 import sys
----> 3 import ABus_Client as ABus
      4 
      5 

ModuleNotFoundError: No module named 'ABus_Client'

Output from Console window (Help->Developer Tools menu)

Starting Jupyter Notebook
jupyter notebook --no-browser --port=8888 --NotebookApp.allow_origin="*"
[I 11:12:30.721 NotebookApp] JupyterLab beta preview extension loaded from D:\Anaconda3\lib\site-packages\jupyterlab
[I 11:12:30.721 NotebookApp] JupyterLab application directory is D:\Anaconda3\share\jupyter\lab
[I 11:12:30.941 NotebookApp] Serving notebooks from local directory: c:\Users\migue\Box\Co_Proj
[I 11:12:30.941 NotebookApp] 0 active kernels
[I 11:12:30.941 NotebookApp] The Jupyter Notebook is running at:
[I 11:12:30.941 NotebookApp] http://localhost:8888/?token=f6b64f46c5f915c50373ca8fd8af1b40b1231d1b47237f22
[I 11:12:30.941 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 11:12:30.943 NotebookApp] 

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=f6b64f46c5f915c50373ca8fd8af1b40b1231d1b47237f22
[I 11:12:31.649 NotebookApp] Kernel started: 6e302445-fc4c-41e4-9599-87ba9c2751f4
[I 11:12:32.268 NotebookApp] Adapting to protocol v5.1 for kernel 6e302445-fc4c-41e4-9599-87ba9c2751f4

Actual behavior

The Jupyter extension refuses to import a module that is stored in the same directory than the current code.

Expected behavior

Traditional Jupyter nodebooks are able to import this module with the current syntax.

Steps to reproduce:

socoi commented 6 years ago

Same problem. Did you fix it?

vdsvv commented 6 years ago

This works for me:

image

jbmusso commented 6 years ago

Related: https://github.com/DonJayamanne/vscodeJupyter/issues/79