By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,054 Members | 1,249 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,054 IT Pros & Developers. It's quick & easy.

Importing a python module/site-package (e.g. scipy) works from a script (, bu

P: 1
Importing a python site-package (e.g. 'scipy') works fine from a script, but NOT from tkinter button command. When click the button, error shows:

ModuleNotFoundError: No module named 'scipy'

import scipy
print ("hello world")

import sys
import os
import tkinter

def startCamera():

B=tkinter.Button(top,text="hello",command= startCamera)

Both the and are in a same folder: C:\Users\Breda\PycharmProjects\face_reg\face

scipy package in: C:\Users\Breda\Anaconda3\Lib\site-packages

sys.path variable contains: C:\Users\Breda\Anaconda3\Lib\site-packages

I tried to import other site-packages in and run via GUI button command, all face the same problem. Any ideas?
Dec 18 '17 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.