ImportError: No module named utils
[root@trcloud-gtt-dw python]cat email.py
import smtplib
print 'aaa'
[root@trcloud-gtt-dw python]# python email.py
aaa
Traceback (most recent call last):
File "email.py", line 3, in
import smtplib
File "/usr/lib64/python2.6/smtplib.py", line 46, in
import email.utils
ImportError: No module named utils
一個簡單的語句報錯原因是因為檔名email.py和module名重複了,python會優先呼叫當前path上的,修改掉email.py就可以了
import smtplib
print 'aaa'
[root@trcloud-gtt-dw python]# python email.py
aaa
Traceback (most recent call last):
File "email.py", line 3, in
import smtplib
File "/usr/lib64/python2.6/smtplib.py", line 46, in
import email.utils
ImportError: No module named utils
一個簡單的語句報錯原因是因為檔名email.py和module名重複了,python會優先呼叫當前path上的,修改掉email.py就可以了
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29989552/viewspace-2129858/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ImportError: No module named torchvisionImportError
- ImportError: No module named `defusedxml`ImportErrorXML
- ImportError: No module named ‘torch‘ 解決方法ImportError
- 啟動uwsgi報錯ImportError: No module named, unable to load appImportErrorAPP
- pyecharts安裝後import錯誤 ImportError: No module named 'pyecharts_snapshot'EchartsImportError
- pycharm環境,命令列執行提示:ImportError: No module named xxx 解決方法PyCharm命令列ImportError
- ImportError: No module named flask 導包失敗,Python3 重新安裝 Flask 模組ImportErrorFlaskPython
- ModuleNotFoundError: No module named 'pyttsx'ErrorTTS
- Bug: No module named ‘pytest‘
- linux已經安裝bert4keras但出現ImportError: No module named ‘bert4keras‘LinuxKerasImportError
- ModuleNotFoundError: No module named ‘Crypto‘ ‘Cryptodome‘Error
- ModuleNotFoundError: No module named 'phkit.pinyin'Error
- No module named MYSQLdb 問題解決MySql
- Linux:Python報錯:No module named MySQLdbLinuxPythonMySql
- ModuleNotFoundError: No module named ‘DBUtils‘解決辦法Error
- 使用PyCharm時顯示的 No module named ‘xxx’PyCharm
- python ModuleNotFoundError: No module named ‘requests‘ 的 解決方案PythonError
- ModuleNotFoundError: No module named ‘cv2’——(版本問題)Error
- 【已解決】ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.ImportError
- ImportError: cannot import name 'get_ora_doc' from partially initialized moduleImportErrorZed
- yum依賴python2環境-"No module named urlgrabber"Python
- 問題結局辦法:Error loading psycopg2 module: No module named ‘psycopg2‘Error
- ModuleNotFoundError: No module named ‘matplotlib‘ 一系列解決辦法Error
- 解決Python找不到ssl模組問題 No module named _sslPython
- 解決:ModuleNotFoundError: No module named ‘urllib3.packages.six.moves問題ErrorPackage
- 使用Pycharm出現No module named Test_01_module_a less... (Ctrl+F1) This inspection detects names that shPyCharm
- catkin_make出現 No module named 'catkin_pkg'(親測穩過)
- centos 解決python3.7 安裝時No module named _ssl 親測有效CentOSPython
- 記錄安裝conda install Python庫時報No module named ‘tensorflow‘錯誤Python
- Python UtilsPython
- centos安裝Python外掛後找不到對應的外掛ModuleNotFoundError: No module named*CentOSPythonError
- pip成功安裝gdal的whl檔案後,PyCharm仍報錯No module named ‘osgeo’PyCharm
- pip install了之後還是顯示no module named xxx的解決辦法
- Ubuntu20.04安裝LabelImg 以及出現(ModuleNotFoundError: No module named libs.resources)錯誤UbuntuError
- Python3出現"No module named 'MySQLdb'"問題-以及使用PyMySQL連線資料庫PythonMySql資料庫
- 解決已安裝opencv但仍提示報錯“no module named cv2“問題OpenCV
- openpyxl utils 模組
- C# Common utilsC#
- ImportError: cannot import name parseImportError