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.

Cannot import so module

See original GitHub issue

Cannot import compiled SO module fmodule in the notebook. In the old VS-CODE Jupyter notebook extension it works just fine, therefore I think it is an issue with this new jupyter extension.

import sys
sys.path.append('.')
import fmodule
ModuleNotFoundError: No module named 'fmodule' --------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) <ipython-input-9-bb0155c26dc3> in <module> ----> 1 import fmodule ModuleNotFoundError: No module named 'fmodule'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rchiodocommented, Feb 26, 2021

It prints the location of my home directory on the server. This is not where the files are located. My files are stored locally on my laptop. I can change the directory to some other location on the server, however, I don’t know how to change it to my local machine.

If you’re using remote, it cannot load any of the local files. We do not copy files to the remote server nor do we control the working directory of the remote server.

Your best bet (as you found) is to use Remote SSH instead. That will then run the server and the files on the remote machine. Of course you then have to put your files on the remote machine.

0reactions
AlexanderZeilmanncommented, Feb 26, 2021

If you’re using remote, it cannot load any of the local files. We do not copy files to the remote server nor do we control the working directory of the remote server.

Ahh, I understand, thank you for the clarification 😃 I don’t know, why I assumed that I can use local files and remote kernel 🙈

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't import my own modules in Python
In your particular case it looks like you're trying to import SomeObject from the myapp.py and TestCase.py scripts. From myapp.py, do
Read more >
How to Fix ModuleNotFoundError and ImportError
How to fix ModuleNotFoundError and ImportError? · first make sure you are using absolute imports · export the project's root directory to ...
Read more >
Traps for the Unwary in Python's Import System
The reason this is problematic is that every module in that directory is now potentially accessible under two different names: as a top...
Read more >
I can't import a module (a .py file) in my Python shell. What ...
If you are unable to import a module (a .py file) in your Python shell, it may be because the module is not...
Read more >
ModuleNotFoundError: no module named Python Error ...
When you try to import a module in a Python file, Python tries to resolve this module in several ways. · As the...
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