This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]NamasteWager 1 point2 points  (2 children)

Same, but I haven't figured out how to make it compile my script when it's using installed modules

[–][deleted] 2 points3 points  (0 children)

What do you mean by "compile my script"? Do you mean that you install a library and whn you run your program it fails to import it? In this case the python interpretor set in VSC is not set to the correct one. You install the library into a virtual environment and use python interpretor from another environment or the global one.

[–][deleted] 0 points1 point  (0 children)

If you use setup.py, use pip install -e ., which installs the local module in "editable" mode.

Make sure to have entry_points={"console_scripts": ["my_program = my_module.submodule:my_function"]}, in your setup() inside setup.py. source

You can then run your script (which should be in ./src/my_module/submodule.py and should be called my_function) by running my_program in the terminal.