pip install

时间:2018-01-09 02:48:05

标签: python django pip install

  1. 我在docker中安装了一些lib pip3.4安装 安装完成后,我收到了消息Successfully installed <lib>

  2. 我检查了pip3.4 list的安装情况,并在列表中

  3. 我在设置中编写代码

    MIDDLEWARE_CLASSES += (<lib>,)
    INSTALLED_APPS += (<lib>,)
    
  4. Pycharm中的Runserver,我得到了MSG

    Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7f1b69b9b400>
    Traceback (most recent call last):
      File "/usr/local/lib/python3.4/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(*args, **kwargs)
      File "/usr/local/lib/python3.4/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run autoreload.raise_last_exception()
      File "/usr/local/lib/python3.4/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception six.reraise(*_exception)
      File "/usr/local/lib/python3.4/site-packages/django/utils/six.py", line 685, in reraise raise value.with_traceback(tb)
      File "/usr/local/lib/python3.4/site-packages/django/utils/autoreload.py", line 226, in wrapper fn(*args, **kwargs)
      File "/usr/local/lib/python3.4/site-packages/django/__init__.py", line 18, in setup apps.populate(settings.INSTALLED_APPS)
      File "/usr/local/lib/python3.4/site-packages/django/apps/registry.py", line 85, in populate app_config = AppConfig.create(entry)
      File "/usr/local/lib/python3.4/site-packages/django/apps/config.py", line 90, in create module = import_module(entry)
      File "/usr/local/lib/python3.4/importlib/__init__.py", line 109, in import_module return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
      File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
      File "<frozen importlib._bootstrap>", line 2224, in _find_and_load_unlocked
    ImportError: No module named 'silk'
    

1 个答案:

答案 0 :(得分:0)

可能的问题之一是lib被安装到解释器a的环境中,而PyCharm正在使用解释器b

使用pip3.4 show [pkg_name]查看包的位置,并确保PyCharm中的项目解释器是相同的。