Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 99142

Why is VSCODE not accepting Python import statements when Pycharm is?

$
0
0

Today, I have updated a code repository and moved around some code/directories. In Pycharm I have debugged it and it's running with no errors (and all imports working). When I open the same project directory in VSCODE it gives me import-errors saying it is unable to import my modules, however it can import the packages. If I retype the exact same import statement in VSCODE, it now works (see image, for reference I have checked with only one statement and it still works). Why does it do this?

Import statement example screenshot

I have tried clearing the caches (using "Clear Editor History" in command palette). As well as putting

"env": {"PYTHONPATH": "${workspaceRoot}"}

in my launch.json

VSCODE: 1.39.2 with Docker, Importmagic and Python extensions. Ubuntu 18.04 LTS Python 3.7.5 in a venv

Can someone suggest how I go about resolving this without having to retype all my import statements. I know it'll be something simple but after a quick search I can't seem to resolve it.

Thanks!


Viewing all articles
Browse latest Browse all 99142

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>