1

I've searched for this on SO but to no avail.

I have a module in "./my folder/folder", this has a space and im having troubles importing this in my py file see below.

import "my folder.folder"

Leads to an error.

martineau
  • 119,623
  • 25
  • 170
  • 301
  • 3
    Can't you just remove the space or replace it with an underscore? – forgetso Jun 30 '20 at 18:19
  • 1
    `foo_bar_baz = __import__("foo bar.baz")` should work; check the above question. – Nishant Jun 30 '20 at 18:24
  • Categorically, spaces in a file path is a bad idea. (Thanks for facilitating bad behaviour MS!). If possible, rename the file path, it’ll save you a lot of headache (generally speaking). – S3DEV Jun 30 '20 at 18:31

0 Answers0