0

I have multiple python scripts, py1 results used to calculate py2 results, py2 results used to calculate py3 results...

trying to use bat to run these files py1 first and py2 second....... It always shows NumPy not found, also cannot use the results of another script. Anyone can help, really appreciated. Thanks

Code: My python scripts example:

py1: d = int(7) def task(): return int(d) d1 = task()

py2: from py1 import d1

def task_1():
   h =5
   g2 =h+d1
   return g2

g2 = test_1()

py3: from py2 import g2

My Bat file code like this:

@echo off

"C:\Users\name\Anaconda3\python.exe" "C:\Users\name\Desktop\test_auto\py1.py" & "C:\Users\name\Desktop\test_auto\py2.py" & "C:\Users\name\Desktop\test_auto\py3.py" & pause

1 Answer 1

0

Make sure you have had imported NumPy in all your python files. Also here's a link to import the variables from other python file: Import Variable from Python FilePath

Hope I had helped you, If you have any question, you can reply me.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for your quick response. I tried the method you provided, it works well in spyder. When I run bat file, same questions: no module named numpy.
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.