No Module Found, But Site-Packages has already install the Libs #19400
Answered
by
brettcannon
shjustinzhang
asked this question in
Q&A
|
I have 2 py files, main call sub. tt_main.py: #!/usr/bin/env python37
import os
import csv
import sys,re
import fileinput
import pandas as pd
import openpyxl
from csv import reader
print('AA')
def test():
os.popen(r"python tt_sub.py","r")
if True:
test()tt_sub.py #!/usr/bin/env python37
import os
import csv
import sys,re
import fileinput
import pandas as pd
import openpyxl
from csv import reader
print('AA')The result : And if I run tt_sub.py only, just have clear output AA. I have already done the checks below, but so far, none of them get works. Part B: VScode Setting "python.pythonpath": "C:\\Users\\juntizha\\AppData\\Local\\Programs\\Python\\Python37\\python37.exe",
"python.testing.pytestArgs": [
"."
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.autoComplete.addBrackets": true,
"python.autoComplete.extraPaths":
[
"C:/Users/juntizha/AppData/Local/Programs/Python/Python37/Lib/site-packages"
], |
Answered by
brettcannon
Jul 4, 2022
Replies: 1 comment 4 replies
|
It's because you're using |
4 replies
Answer selected by
shjustinzhang
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment




It's because you're using
popento executepythonwhich has no guarantee of being the same Python as the one you executedtt_main.pywith. If you want to launch a subprocess that uses the same Python as you started with, I would usesubprocessand specify the binary to use assys.executable.