Author Topic: Importing Python Modules in windows  (Read 36 times)


  • Newbie
  • *
  • Posts: 6
  • Karma: 0
  • Scribus User
Importing Python Modules in windows
« on: April 17, 2019, 11:46:45 am »
Hey all,

When i tried to import a module into scribus on windows, it always said that the module was not installed, even if Environment variables were setup and the module was correctly installed on python itself.

I therefore ran this inside the console in Scribus

Code: [Select]
import pip
pip.main(['install', '<moduleName>'])

This installs the package for all users for Scribus, after a restart of Scribus you can use it in the console or in your scripts.

I don't know if this is the best way to do it, but it works for me. Hope this helps someone

PS: pip has to be installed i suppose. For me that worked without any troubles


  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1818
  • Karma: 26
    • the graphics lab
Re: Importing Python Modules in windows
« Reply #1 on: April 18, 2019, 10:36:35 am »
hoi michi

would you mind testing this?

# doing execfile() on this file will alter the current interpreter's
# environment so you can import libraries in the virtualenv
activate_this_file = "/path/to/virtualenv/bin/"

execfile(activate_this_file, dict(__file__=activate_this_file))

if you're using "-m venv" you'll probably need to find the virtualenv's ""...

i've not tested it, but it looks like a solution for your problem... slightly better than running pip from inside of scribus (which, imo, looks like a wonderful hack to me!)