ImportError:使用pip3安装后没有名为“…”的模块

2024-09-30 03:24:56 发布

您现在位置:Python中文网/ 问答频道 /正文

我尝试在Python3.5中使用模块^{}。我是这样安装的:

anubis:~ TheoAdmin$ pip3 install python-docx
Collecting python-docx
  Downloading python-docx-0.8.6.tar.gz (5.3MB)
    100% |████████████████████████████████| 5.3MB 172kB/s 
Collecting lxml>=2.3.2 (from python-docx)
  Downloading lxml-4.1.1-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (8.7MB)
    100% |████████████████████████████████| 8.7MB 115kB/s 
Building wheels for collected packages: python-docx
  Running setup.py bdist_wheel for python-docx ... done
  Stored in directory: /Users/TheoAdmin/Library/Caches/pip/wheels/cc/74/10/42b00d7d6a64cf21f194bfef9b94150009ada880f13c5b2ad3
Successfully built python-docx
Installing collected packages: lxml, python-docx
Successfully installed lxml-4.1.1 python-docx-0.8.6

但是,当我试图在REPL中使用它时:

^{pr2}$

为什么会这样?在

编辑:

anubis:BananaSplit TheoAdmin$ pip3 -V
pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)

anubis:BananaSplit TheoAdmin$ python3 -m site
sys.path = [
    '/Users/TheoAdmin/Documents/GitHub/BananaSplit',
    '/Library/Frameworks/Python.framework/Versions/3.5/lib/python35.zip',
    '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5',
    '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/plat-darwin',
    '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/lib-dynload',
    '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages',
    '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/PyDictionary-1.3.9-py3.5.egg',
    '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests-2.13.0-py3.5.egg',
    '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/goslate-1.5.1-py3.5.egg',
    '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/beautifulsoup4-4.5.3-py3.5.egg',
    '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/futures-3.0.5-py3.5.egg',
    '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-34.4.0-py3.5.egg',
]
USER_BASE: '/Users/TheoAdmin/Library/Python/3.5' (doesn't exist)
USER_SITE: '/Users/TheoAdmin/Library/Python/3.5/lib/python/site-packages' (doesn't exist)
ENABLE_USER_SITE: True

anubis:BananaSplit TheoAdmin$ which pip3
/usr/local/bin/pip3

Tags: egglibpackagespip3librarysiteframeworkmb

热门问题