我在Docker中安装pipenv:
RUN pip install pipenv
RUN cd /my/app/path/ && pipenv install
RUN cd /my/app/path/ && pipenv shell
我收到错误:
Traceback (most recent call last):
File "/usr/local/bin/pipenv", line 11, in <module>
sys.exit(cli())
File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pipenv/cli.py", line 2057, in shell
do_shell(three=three, python=python, fancy=fancy, shell_args=shell_args)
File "/usr/local/lib/python2.7/dist-packages/pipenv/cli.py", line 1952, in do_shell
shell = os.path.abspath(PIPENV_SHELL)
File "/usr/lib/python2.7/posixpath.py", line 360, in abspath
if not isabs(path):
File "/usr/lib/python2.7/posixpath.py", line 54, in isabs
return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'
如果我跑步
RUN cd /my/app/path/ && pipenv install --system
相反,即时通讯收到另一个错误:
build 30-Sep-2017 16:50:45 Step 5/9 : RUN cd /my/app/path && pipenv install --system
build 30-Sep-2017 16:50:45 ---> Running in cffd31633074
build 30-Sep-2017 16:50:46 [91mPipfile.lock not found, creating…
build 30-Sep-2017 16:50:46 [0m[91mLocking [dev-packages] dependencies…
build 30-Sep-2017 16:50:46 [0m[91mLocking [packages] dependencies…
build 30-Sep-2017 16:50:49 [0m[91mCRITICAL:pip.utils:Error [Errno 2] No such file or directory while executing command python setup.py egg_info
build 30-Sep-2017 16:50:49 [0m[91mTraceback (most recent call last):
build 30-Sep-2017 16:50:49 File "/usr/local/bin/pipenv", line 11, in <module>
build 30-Sep-2017 16:50:49 sys.exit(cli())
build 30-Sep-2017 16:50:49 File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 722, in __call__
build 30-Sep-2017 16:50:49 [0m[91m return self.main(*args, **kwargs)
build 30-Sep-2017 16:50:49 File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 697, in main
build 30-Sep-2017 16:50:49 [0m[91m rv = self.invoke(ctx)
build 30-Sep-2017 16:50:49 File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 1066, in invoke
build 30-Sep-2017 16:50:49 [0m[91m return _process_result(sub_ctx.command.invoke(sub_ctx))
build 30-Sep-2017 16:50:49 File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 895, in invoke
build 30-Sep-2017 16:50:49 [0m[91m return ctx.invoke(self.callback, **ctx.params)
build 30-Sep-2017 16:50:49 File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 535, in invoke
build 30-Sep-2017 16:50:49 return callback(*args, **kwargs)
build 30-Sep-2017 16:50:49 File "/usr/local/lib/python2.7/dist-packages/pipenv/cli.py", line 1782, in install
build 30-Sep-2017 16:50:49 [0m[91m do_init(dev=dev, allow_global=system, ignore_pipfile=ignore_pipfile, system=system, skip_lock=skip_lock, verbose=verbose, concurrent=concurrent, deploy=deploy)
build 30-Sep-2017 16:50:49 File "/usr/local/lib/python2.7/dist-packages/pipenv/cli.py", line 1290, in do_init
build 30-Sep-2017 16:50:49 [0m[91m do_lock(system=system)
build 30-Sep-2017 16:50:49 File "/usr/local/lib/python2.7/dist-packages/pipenv/cli.py", line 1080, in do_lock
build 30-Sep-2017 16:50:49 [0m[91m pre=pre
build 30-Sep-2017 16:50:49 File "/usr/local/lib/python2.7/dist-packages/pipenv/utils.py", line 421, in resolve_deps
build 30-Sep-2017 16:50:49 [0m[91m resolved_tree.update(resolver.resolve())
build 30-Sep-2017 16:50:49 File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/piptools/resolver.py", line 101, in resolve
build 30-Sep-2017 16:50:49 [0m[91m has_changed, best_matches = self._resolve_one_round()
build 30-Sep-2017 16:50:49 File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/piptools/resolver.py", line 199, in _resolve_one_round
build 30-Sep-2017 16:50:49 [0m[91m for dep in self._iter_dependencies(best_match):
build 30-Sep-2017 16:50:49 File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/piptools/resolver.py", line 293, in _iter_dependencies
build 30-Sep-2017 16:50:49 dependencies = self.repository.get_dependencies(ireq)
build 30-Sep-2017 16:50:49 File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 171, in get_dependencies
build 30-Sep-2017 16:50:49 result = reqset._prepare_file(self.finder, ireq)
build 30-Sep-2017 16:50:49 File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/pip/req/req_set.py", line 639, in _prepare_file
build 30-Sep-2017 16:50:49 [0m[91m abstract_dist.prep_for_dist()
build 30-Sep-2017 16:50:49 File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/pip/req/req_set.py", line 134, in prep_for_dist
build 30-Sep-2017 16:50:49 [0m[91m self.req_to_install.run_egg_info()
build 30-Sep-2017 16:50:49 File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/pip/req/req_install.py", line 438, in run_egg_info
build 30-Sep-2017 16:50:49 [0m[91m command_desc='python setup.py egg_info')
build 30-Sep-2017 16:50:49 File "/usr/local/lib/python2.7/dist-packages/pipenv/patched/pip/utils/__init__.py", line 667, in call_subprocess
build 30-Sep-2017 16:50:49 [0m[91m cwd=cwd, env=env)
build 30-Sep-2017 16:50:49 File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
build 30-Sep-2017 16:50:49 [0m[91m errread, errwrite)
build 30-Sep-2017 16:50:49 File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
build 30-Sep-2017 16:50:49 [0m[91m raise child_exception
build 30-Sep-2017 16:50:49 OSError: [Errno 2] No such file or directory
error 30-Sep-2017 16:50:49 The command '/bin/sh -c cd /opt/supercrunch/function-service/lib && pipenv install --system' returned a non-zero code: 1
build 30-Sep-2017 16:50:49 [0mSending build context to Docker daemon 40.96 kB
但是当我改为执行以下操作时:
RUN pip install pipenv
RUN cd /my/app/path && pipenv install
RUN cd /my/app/path && pipenv install --system
这是工作…
于是两个问题:第一:为什么pipenv shell
给我这个错误,第二:为什么我必须做pipenv install
之前pipenv install --system
得到它的工作?
我想使用pipenv创建具有不同python版本和不同依赖版本的虚拟环境。
考虑到您的问题,据我所知,最简单的方法是更新到的最新版本pipenv
。它仍在开发中,因此很快就解决了问题。
我们在生产中使用pipenv
with docker
。我们真的很喜欢。有几件事要牢记:
--system
flag,因此它将所有软件包安装到系统python中,而不是安装到中virtualenv
。由于docker
容器不需要具有virtualenv
s--deploy
标志,所以如果您Pipfile.lock
的版本过时,构建将失败--ignore-pipfile
,因此不会与我们的设置混淆检查官方文档,以确保此信息是最新的。
总而言之:
pipenv install --system --deploy --ignore-pipfile
还有一件事。如果您Dockerfile
在开发和生产中都使用相同的--dev
标记,那么最好仅在开发环境中使用flag。
另外,请查看我们的django
项目模板以查看完整的示例:wemake-django-
template
问题内容: 交互启动Alpine Docker容器时如何自动运行?我已经向文件中添加了一些别名并将其放置在中,但是当我使用来启动容器时,我的别名没有处于活动状态。我每次必须从命令行手动键入。 登录时是否需要其他配置才能运行?我在使用文件时也遇到了问题。任何见解表示赞赏! 编辑: 根据VonC的回答,我拉出并运行了他的示例容器。这是我得到的: 尽管该文件存在,但是在我登录并且未更新我的环境变量时,该
我试图在VM中运行Docker中的GoCD服务器。为了测试这个设置,我在VirtualBox中创建了一个Ubuntu14.04服务器,安装了Docker,然后按照 所以我又试了一次(在一个新的VM中),点击Ctrl+C,等待它关闭,然后运行: 后来呢 此外,Ubuntu VM在VirtualBox中配置有NAT和桥接网卡。
Docker-compose.yaml 我怎么能那么做?
我只是花了一些时间试图将现有的android studio项目从Gradle1.8迁移到Gradle1.9final(昨天11月19日发布),但失败了。 我在这里读了大多数其他与年级相关的帖子,但没有一个对我有用。以下是我到目前为止尝试过的内容: null
是否可以在lambda中运行docker? 错误:响应:{“errorType”:“Runtime.ExitError”,“errorMessage”:“RequestId:d7a7dc46-b4e2-439b-a16b-e4ee1de1f7c5错误:运行时已退出,但出现错误:退出状态127”} 请求ID:“d7a7dc46-b4e2-439b-a16b-e4ee1de1f7c5” 函数日志: S
我对OSGi不是完全的新手,但显然已经够新手了。 我想做的是编写一个OSGi(ApacheFelix)包,并将Java脚本API(JSR-223)与Groovy结合使用。为此,我安装了groovy 2.4.12,它已经是一个OSGi捆绑包,我将groovy运行时(2.4.12)视为Felix远程Shell控制台中的一个活动服务。 我也理解Java的ServiceLoader API和OSGi的捆绑