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.

ModuleNotFoundError: No module named ''; 'typing' is not a package

See original GitHub issue


OS: Windows 10 Professional x64, Build 1909 Python: 3.8.10 VSCode: 1.58.2 AREPL: 2.0.2

When using importlib.resources, AREPL generates the error:

File "C:\Program Files\Python38\lib\importlib\", line 13, in <module>
    from import BinaryIO, TextIO
ModuleNotFoundError: No module named ''; 'typing' is not a package

Minimal Example

  1. Create python 3.8.10 virtual environment with venv in project folder:
py -m venv .venv
  1. Create VSCode user settings to point AREPL to virtual environment:
"AREPL.pythonPath": "${workspaceFolder}\\.venv\\Scripts\\python.exe"
  1. Create file in project folder
  2. Import importlib.resources in
import importlib.resources as rsrc
  1. Click cat button for AREPL to run repl

Expected Behavior AREPL uses virtual environment and is able to import importlib.resources

Screenshots image


Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

Almenoncommented, Oct 15, 2022

I believe this is related to AREPL’s typescript code.

The Typescript code doesn’t have much to do with the python code outside of spawning the process and pipe I/O. The issue is more likely to be with the AREPL python code, which does some funky stuff around importing so there is a fresh state each time.

One thing that’s pretty weird is that I don’t get this bug with python 3.9, only 3.8 and 3.10 (haven’t checked 3.11). I also can’t reproduce the issue in a unit test. @adam-grant-hendry do you get this issue with 3.9?

Also, adding “” to the modules_to_keep variable in C:\Users\<yourUser>\.vscode\extensions\almenon.arepl-2.0.3\node_modules\arepl-backend\python\ (insert after line 27) fixes the issue on my end. Does it fix the issue for you?

gulash007commented, Jun 28, 2022

Hello, can you please explain how exactly did you fixed it ? Do i need to do it on VS code. Where can i find the file ?

Sorry for a late reply. For what it’s worth, the file is a part of the importlib library. On my mac it’s located at /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/

Read more comments on GitHub >

github_iconTop Results From Across the Web

ImportError: No module named 'typing' when trying to install a ...
pip itself is failing as it tries to import typing and typing is not installed. so you cannot run pip install to fix...
Read more >
Importerror no module named typing : Tricks to Fix
Importerror no module named typing error cause is either Typing python module is not available or its installation is improper.
Read more >
[Fixed] ModuleNotFoundError: No module named 'typing ...
Solution Idea 1: Install Library typing-extensions ... The most likely reason is that Python doesn't provide typing-extensions in its standard library. You need ......
Read more >
ImportError: No module named 'typing' in Python | bobbyhadz
The Python "ImportError: No module named 'typing'" occurs when we use an outdated version of pip . To solve the error, run the...
Read more >
Python: ImportError: No module named typing
Problem: Installing joblib module is throwing error: # pip install joblib ... ImportError: No module named typing Trying to install typing, ...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found