当我运行pip list时,我得到以下结果 - 我使用的是Mac OS2.7版本:
➜ python --version
Python 2.7.10
➜ pip list
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Package Version
------------------ -------
pathlib 1.0.1
pip 19.0.2
python-http-client 3.2.7
setuptools 40.8.0
wheel 0.33.0
现在我的代码中有:
from pathlib import Path
当我从命令行运行时,我会得到以下结果:
Traceback (most recent call last):
File "testexe.py", line 7, in <module>
from pathlib import Path
ImportError: No module named pathlib