473,503 Members | 2,157 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

ModuleNotFoundError: No module named 'scipy'

<<test.py>>
import scipy
print ("hello world")

<<GUI.py>>
import sys
import os
import tkinter
top=tkinter.Tk()

def startCamera():
os.system('python test.py')

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




Both the test.py and GUI.py 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 test.py and run via GUI button command, all face the same problem. Any ideas?
Dec 18 '17 #1
0 2066

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

Similar topics

6
4258
by: sj | last post by:
I have written several small shell utilities in Python and typically use comments at the start of the source file as documentation. A command line option allows the user to read this documentation....
5
4761
by: Bart Simpson | last post by:
Hi, I want to control 'Scheduled Tasks' in Windows 2003 by python program. But I couldn't find any Python module about win32 'Scheduled Tasks'. I could find only Perl module about it. (see...
12
2462
by: JD | last post by:
This is another Python problem, I think might be unrelated to the earlier bug I found, and eventually figured out how to report it to Sourceforge. This is related to a question I have about...
1
1401
by: Wroozee | last post by:
hi, I am pretty new to python and i came up with this problem. What i'm trying to do is call a python module from my cgi script, which is inovked by a html form. First the cgi script gets a...
1
2548
by: wen | last post by:
i have written python extend module by c/c++, but i saw a module of a software(pyMOL, you can get it from http://pymol.sourceforge.net/) called _cmd.pyd instead of _cmd.dll. and it is written by...
7
1502
by: ajikoe | last post by:
Hello, I have an idea to build python module to speed up python code in some of field where pyrex shines such as numeric, code which needs a lot of looping etc. What do you think? ...
3
3126
by: vml | last post by:
Hello, I am really new in python scipy win32com and scipy I tried to setup a COM server to interact with vb 6 the pythom COM server is : from win32com.server import exception, register import...
3
15198
by: ajmh | last post by:
Hi , I am very new to python, I have intalled numpy, scipy and ipython to the best of my abilities, when I use the command from scipy import * I get an error message no module named...
4
2162
by: rkmr.em | last post by:
Hi I have a function data, that I need to import from a file data, in the directory data If I do this from python interactive shell (linux fedora core 8) from dir /home/mark it works fine: ...
0
1091
by: Gabriel Genellina | last post by:
En Thu, 10 Jul 2008 14:02:29 -0300, Bhagwat Kolde <bbkolde@gmail.com> escribi�: If it is a single Python module, you can put it anywhere in the Python path. A good place may be the...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7008
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5594
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5022
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3168
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
399
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.