2017-09-30 7 views
2

임 내 고정 표시기에 pipenv를 설치 :docker에서 pipenv를 실행하는 방법은 무엇입니까?

RUN pip install pipenv 
RUN cd /my/app/path/ && pipenv install 
RUN cd /my/app/path/ && pipenv shell 

임 오류 점점 : 내가 대신

RUN cd /my/app/path/ && pipenv install --system 

을 실행하면

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' 

을, 메신저는 다른 오류 점점 :

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 install을 어떻게해야합니까 : 왜 pipenv shell 나에게이 오류와 둘째를 제공 pipenv install --system 작동하려면?

다른 python 버전 및 differne 종속성 버전으로 가상 환경을 작성하려면 pipenv를 사용하고 싶습니다.

+0

가 문제처럼 보인다 시도, 심지어는 대화 형 쉘에서 실행되지 않습니다. 따라서 Dockerfile에서 실행되지 않습니다. RUN 명령을 실행할 때 쉘을 얻을 수 없기 때문입니다. 모두 TTY없이 실행됩니다. 그러나 컨테이너를 실행하여 셸을 만드는 것조차도 작동하지 않으므로 pipenv 팀과 함께 문제를 열어야합니다. –

답변

0

source `pipenv --venv`/bin/activate 
+0

질문에 대한 답변을 제공하지 않습니다. 충분한 [평판] (https://stackoverflow.com/help/whats-reputation)이 있으면 [모든 게시물에 주석 달기] (https://stackoverflow.com/help/privileges/comment) 할 수 있습니다. 대신, [질문자의 설명이 필요없는 답변을 제공하십시오] (https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can- i-do- 대신). - [리뷰에서] (리뷰/저품절 포스트/18337224) – thewaywewere

+0

답변을 업데이트하고 현재 수행중인 작업을 설명해 주실 수 있습니까? 사전에 많은 감사합니다 – MZaragoza

+0

이것은 질문에 대한 답변을 제공하지 않습니다. 충분한 [평판] (https://stackoverflow.com/help/whats-reputation)이 있으면 [모든 게시물에 주석 달기] (https://stackoverflow.com/help/privileges/comment) 할 수 있습니다. 대신, [질문자의 설명이 필요없는 답변을 제공하십시오] (https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can- i-do- 대신). - [리뷰에서] (리뷰/저품절 게시물/18338029) – Rabbid76