2016-04-01 14 views
0

私はgithubのからPythonパッケージのクローンを作成してから、次のようにpip -eでローカルにインストールしようとしています:Dockerfileにpipパッケージをローカルにインストールするには?

RUN git clone https://github.com/st4lk/django-rest-social-auth.git 
RUN pip install -e django-rest-social-auth 

が、私はエラーメッセージを取得:間違って何

Step 6 : RUN pip install -e django-rest-social-auth 
---> Running in 8943e688573f 
Traceback (most recent call last): 
    File "/usr/bin/pip", line 9, in <module> 
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')() 
    File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 356, in load_entry_point 
    return get_distribution(dist).load_entry_point(group, name) 
    File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2476, in load_entry_point 
    return ep.load() 
    File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2190, in load 
    ['__name__']) 
    File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 74, in <module> 
    from pip.vcs import git, mercurial, subversion, bazaar # noqa 
    File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in <module> 
    from pip.download import path_to_url 
    File "/usr/lib/python2.7/dist-packages/pip/download.py", line 25, in <module> 
    from requests.compat import IncompleteRead 
ImportError: cannot import name IncompleteRead 

を?参照用


Dockerfile

FROM debian:jessie 

ADD . /workflows 

# Install dependencies 

RUN apt-get update && apt-get install -y \ 
    git \ 
    python-django \ 
    python-psycopg2 \ 
    python-django-celery \ 
    rabbitmq-server \ 
    python-django-jsonfield \ 
    python-pip 

RUN pip install djangorestframework \ 
    python-social-auth 

RUN git clone https://github.com/st4lk/django-rest-social-auth.git 

RUN pip install -e django-rest-social-auth 

# Get everything ready and run 

RUN python /workflows/manage.py validate 
RUN python /workflows/manage.py collectstatic --noinput 

CMD python /workflows/manage.py runserver 0.0.0.0:8000 

答えて

2

IncompleteRead名はhttps://github.com/kennethreitz/requests/commit/47d0517d66e8cf5832768262221f0357ae134ad1requests.compatから削除されました。あなたのDockerfileのこのセクションを完了した後

...

RUN apt-get update && apt-get install -y \ 
    git \ 
    python-django \ 
    python-psycopg2 \ 
    python-django-celery \ 
    rabbitmq-server \ 
    python-django-jsonfield \ 
    python-pip 

あなたが要求したバージョン2.4.3と1.5.6ピップを持っています。これらはどちらもかなり古いものです。これはもはやあなたのイメージにインストールpipの古いバージョンと互換性がありません2.9.1へのご依頼パッケージを、アップグレードするときは、次の実行pip install ...

RUN pip install djangorestframework \ 
    python-social-auth 

...。

pipの新しいバージョンをインストールすることで、この問題を回避できます。 むしろpython-pipパッケージをインストールするよりも、単にpipを取得する easy_installを使用します。これはあなたのその後のPythonモジュールをインストールすることにより、必要なインストール要求のバージョンで正常に動作しますpipの最新バージョンをインストールします

RUN apt-get update && apt-get install -y \ 
    git \ 
    python-django \ 
    python-psycopg2 \ 
    python-django-celery \ 
    rabbitmq-server \ 
    python-django-jsonfield 

RUN easy_install pip 

+0

ありがとう、larsks、私はあなたの提案に従って今すぐ作っています。 –

関連する問題