I have the following program:
#!/usr/local/bin/python3
print("Hello")
Via terminal I do test.py
and I get:
Traceback (most recent call last):
File "/usr/lib/python3.3/site.py", line 629, in <module>
main()
File "/usr/lib/python3.3/site.py", line 614, in main
known_paths = addusersitepackages(known_paths)
File "/usr/lib/python3.3/site.py", line 284, in addusersitepackages
user_site = getusersitepackages()
File "/usr/lib/python3.3/site.py", line 260, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/lib/python3.3/site.py", line 250, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/lib/python3.3/sysconfig.py", line 610, in get_config_var
return get_config_vars().get(name)
File "/usr/lib/python3.3/sysconfig.py", line 560, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/lib/python3.3/sysconfig.py", line 432, in _init_posix
from _sysconfigdata import build_time_vars
File "/usr/lib/python3.3/_sysconfigdata.py", line 6, in <module>
from _sysconfigdata_m import *
ImportError: No module named '_sysconfigdata_m'
Instead if I type python3 test.py
it works, I get:
Hello
P.S. which python3
----> /usr/local/bin/python3
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…