1. <legend id='HnVC9'><style id='HnVC9'><dir id='HnVC9'><q id='HnVC9'></q></dir></style></legend>

      <bdo id='HnVC9'></bdo><ul id='HnVC9'></ul>

      <tfoot id='HnVC9'></tfoot>
    1. <i id='HnVC9'><tr id='HnVC9'><dt id='HnVC9'><q id='HnVC9'><span id='HnVC9'><b id='HnVC9'><form id='HnVC9'><ins id='HnVC9'></ins><ul id='HnVC9'></ul><sub id='HnVC9'></sub></form><legend id='HnVC9'></legend><bdo id='HnVC9'><pre id='HnVC9'><center id='HnVC9'></center></pre></bdo></b><th id='HnVC9'></th></span></q></dt></tr></i><div id='HnVC9'><tfoot id='HnVC9'></tfoot><dl id='HnVC9'><fieldset id='HnVC9'></fieldset></dl></div>
    2. <small id='HnVC9'></small><noframes id='HnVC9'>

    3. ModuleNotFoundError:没有名为“versioneer"的模块

      时间:2023-09-10

        <small id='Zp3ZC'></small><noframes id='Zp3ZC'>

        • <legend id='Zp3ZC'><style id='Zp3ZC'><dir id='Zp3ZC'><q id='Zp3ZC'></q></dir></style></legend>
          <tfoot id='Zp3ZC'></tfoot>

            <i id='Zp3ZC'><tr id='Zp3ZC'><dt id='Zp3ZC'><q id='Zp3ZC'><span id='Zp3ZC'><b id='Zp3ZC'><form id='Zp3ZC'><ins id='Zp3ZC'></ins><ul id='Zp3ZC'></ul><sub id='Zp3ZC'></sub></form><legend id='Zp3ZC'></legend><bdo id='Zp3ZC'><pre id='Zp3ZC'><center id='Zp3ZC'></center></pre></bdo></b><th id='Zp3ZC'></th></span></q></dt></tr></i><div id='Zp3ZC'><tfoot id='Zp3ZC'></tfoot><dl id='Zp3ZC'><fieldset id='Zp3ZC'></fieldset></dl></div>
                <tbody id='Zp3ZC'></tbody>

              • <bdo id='Zp3ZC'></bdo><ul id='Zp3ZC'></ul>
                本文介绍了ModuleNotFoundError:没有名为“versioneer"的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我正在使用下面的 dockerfile 来构建图像.

                I am using the below dockerfile to build an image .

                FROM <custom registry>/python:alpine3.7
                # Copy local code to the container image.
                ENV APP_HOME app
                WORKDIR $APP_HOME
                COPY . .
                #RUN pip install versioneer
                RUN pip install Flask google-auth google-cloud-storage numpy datetime pandas sklearn
                ENV PORT 8080
                CMD ["python", "app_hello.py"]
                

                当我尝试进行 docker build 时,它给了我以下错误

                When I tried to do a docker build it gave me the below error

                File "setup.py", line 37, in <module>
                      import versioneer
                  ModuleNotFoundError: No module named 'versioneer'
                  
                  ----------------------------------------
                Command "/usr/local/bin/python /usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmp8gvrvde_" failed with error code 1 in /tmp/pip-install-s551_g8p/numpy
                

                我也尝试安装 versioneer,但没有成功.我在这里错过了什么?

                I tried to install versioneer as well , but it did not work. What am I missing here ?

                推荐答案

                命令/usr/local/bin/python/usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/in_process.py get_requires_for_build_wheel/tmp/tmp8gvrvde"失败,错误代码 1 在/tmp/pip-install-s551_g8p/numpy

                Command "/usr/local/bin/python /usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/in_process.py get_requires_for_build_wheel /tmp/tmp8gvrvde" failed with error code 1 in /tmp/pip-install-s551_g8p/numpy

                构建numpy时出现该错误,这表明您需要升级pip才能使其工作:

                The error happens when build numpy, and this indicates you need to upgrade pip to make it work:

                pip install --upgrade pip
                

                另外,您需要安装编译器以使用 next 进行构建:

                Additional, you need install compiler for build with next:

                apk add build-base
                

                有了上面的例子,接下来是一个可行的 Dockerfile 示例:

                With above, a sample workable Dockerfile as next:

                FROM python:alpine3.7
                RUN pip install --upgrade pip; apk add build-base; pip install numpy
                RUN python -c "import numpy; print(numpy.__version__)"
                

                输出:

                $ docker build -t abc:1 .
                Sending build context to Docker daemon  2.048kB
                Step 1/3 : FROM python:alpine3.7
                 ---> 00be2573e9f7
                Step 2/3 : RUN pip install --upgrade pip; apk add build-base; pip install numpy
                 ---> Running in bba4eed0d626
                Collecting pip
                  Downloading https://files.pythonhosted.org/packages/8a/d7/f505e91e2cdea53cfcf51f4ac478a8cd64fb0bc1042629cedde20d9a6a9b/pip-21.2.2-py3-none-any.whl (1.6MB)
                Installing collected packages: pip
                  Found existing installation: pip 19.0.1
                    Uninstalling pip-19.0.1:
                      Successfully uninstalled pip-19.0.1
                Successfully installed pip-21.2.2
                ...
                Collecting numpy
                  Downloading numpy-1.21.1.zip (10.3 MB)
                ...
                Successfully built numpy
                Installing collected packages: numpy
                Successfully installed numpy-1.21.1
                WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
                Removing intermediate container bba4eed0d626
                 ---> 6e11968fe036
                Step 3/3 : RUN python -c "import numpy; print(numpy.__version__)"
                 ---> Running in 0f4c47db07cd
                1.21.1
                Removing intermediate container 0f4c47db07cd
                 ---> f189962ad246
                Successfully built f189962ad246
                Successfully tagged abc:1
                

                这篇关于ModuleNotFoundError:没有名为“versioneer"的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:docker CMD 中的命令替换 下一篇:Docker:该命令返回一个非零代码:137

                相关文章

                最新文章

                <tfoot id='ExbGb'></tfoot>
              • <legend id='ExbGb'><style id='ExbGb'><dir id='ExbGb'><q id='ExbGb'></q></dir></style></legend>

                • <bdo id='ExbGb'></bdo><ul id='ExbGb'></ul>
                <i id='ExbGb'><tr id='ExbGb'><dt id='ExbGb'><q id='ExbGb'><span id='ExbGb'><b id='ExbGb'><form id='ExbGb'><ins id='ExbGb'></ins><ul id='ExbGb'></ul><sub id='ExbGb'></sub></form><legend id='ExbGb'></legend><bdo id='ExbGb'><pre id='ExbGb'><center id='ExbGb'></center></pre></bdo></b><th id='ExbGb'></th></span></q></dt></tr></i><div id='ExbGb'><tfoot id='ExbGb'></tfoot><dl id='ExbGb'><fieldset id='ExbGb'></fieldset></dl></div>

                <small id='ExbGb'></small><noframes id='ExbGb'>