Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Importing personal modules #122

Open
miguel199 opened this issue May 14, 2018 · 3 comments
Open

Importing personal modules #122

miguel199 opened this issue May 14, 2018 · 3 comments

Comments

@miguel199
Copy link

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:

  • Reproduce the following directory structure:
    • Project
      • ABus_Client.py
      • main.py
  • Import the ABus_Client from the main code with:
    • import ABus_Client as ABus
  • Run the cell
@socoi
Copy link

socoi commented Jun 21, 2018

Same problem. Did you fix it?

@vdsvv
Copy link

vdsvv commented Aug 15, 2018

This works for me:

image

@jbmusso
Copy link

jbmusso commented Aug 24, 2018

Related: #79

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

No branches or pull requests

4 participants