pip没有在setup.py中安装所有依赖项

时间:2018-11-09 04:07:50

标签: python python-3.x pip

pip3:Ubuntu上/ usr / lib / python3 / dist-packages(python 3.6)的pip 9.0.1

我正在安装本地软件包,但是并非所有依赖项都已被收集/安装。以下是我的setup.py文件。

from setuptools import setup, find_packages

with open('requirements.txt') as f:
    required = f.read().splitlines()

setup(
    name='g_plotter',
    packages=find_packages(),
    #packages=['g_plotter', 'pandas'],
    include_package_data=True,
    """ install_requires=[
        'flask',
    ], """
    install_requires=required,
)

requirements.txt:

click==6.6
flask==0.11.1
itsdangerous==0.24
Jinja2==2.10.0
MarkupSafe==0.23
numpy==1.15.4
pandas==0.23.4
python-dateutil==2.5.3
pytz==2016.4
six==1.10.0
Werkzeug==0.11.10
flask-cors

失败之处:

import pandas as pd

追踪

server_1  |   File "./g_server.py", line 21, in <module>
server_1  |     from g_plotter import Gparser
server_1  |   File "/usr/local/lib/python3.7/site-packages/g_plotter/Gparser.py", line 4, in <module>
server_1  |     import pandas as pd
server_1  | ModuleNotFoundError: No module named 'pandas'

此故障正在Docker构建中的此步骤发生。

Step 12/15 : RUN pip3 install ./g_plotter
 ---> Running in 7cc0957f23e6
Processing ./g_plotter
Requirement already satisfied: flask in /usr/local/lib/python3.7/site-packages (from g-plotter==0.0.0) (1.0.2)
Requirement already satisfied: itsdangerous>=0.24 in /usr/local/lib/python3.7/site-packages (from flask->g-plotter==0.0.0) (1.1.0)
Requirement already satisfied: Jinja2>=2.10 in /usr/local/lib/python3.7/site-packages (from flask->g-plotter==0.0.0) (2.10)
Requirement already satisfied: Werkzeug>=0.14 in /usr/local/lib/python3.7/site-packages (from flask->g-plotter==0.0.0) (0.14.1)
Requirement already satisfied: click>=5.1 in /usr/local/lib/python3.7/site-packages (from flask->g-plotter==0.0.0) (7.0)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.7/site-packages (from Jinja2>=2.10->flask->g-plotter==0.0.0) (1.1.0)
Building wheels for collected packages: g-plotter
  Running setup.py bdist_wheel for g-plotter: started
  Running setup.py bdist_wheel for g-plotter: finished with status 'done'
  Stored in directory: /tmp/pip-ephem-wheel-cache-iu6t3zln/wheels/a5/fc/d6/bbda9e5e615cade7b93e6d32cfba9062e2b21ea5352d0c2be0

我还直接在主机上运行了pip install命令,结果相同。这是使用-vvv选项的输出,它也不显示任何缺少的模块。

0 个答案:

没有答案