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

can't import custom python module in vscode

$
0
0

I'm trying to get my vscode project to mimic functionality that pycharm is able to produce. With pycharm, I'm able to create, via an XML, a custom pycharm project file that lists the various different sources of the different folder locations of the custom modules I need to have available.

In vscode, I'm going about this by creating a workspace file and adding these sources as folders in the JSON object. The workspace will populate properly in vscode, but when I try to reference an import, Intellisense is able to see the module I'm trying to import 1 but when I try to start a debug session, vscode barfs and says it can't find this module 2.

My folder structure is:

workspace

|--> obscura

|-->|--> obscura

|-->|-->|--> database.py

|-->|--> obscura_test

|-->|-->|--> mytestfile.py --- where I'm starting debug session

Here are the screenshots:

Intellisense

-- Intellisense shows what the module is

fail to import

-- Vscode fails on debug


Viewing all articles
Browse latest Browse all 97371

Trending Articles



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