Quantcast
Channel: pip install from custom whl file in Dockerfile - Stack Overflow
Viewing all articles
Browse latest Browse all 2

pip install from custom whl file in Dockerfile

$
0
0

I have a Dockerfile which is trying to install a whl file which is located in my project using pip. I want to force pip to include my whl file in its searches, but it doesn't:

No distributions matching the version for mylibname==mylibversion

I tried using build_ext with options -L:

pip install --global-option=build_ext --global-option="-L/directory/containing/whl/file/"

-I:

pip install --global-option=build_ext --global-option="-I/directory/containing/whl/file/"

and -b:

pip install --global-option=build_ext --global-option="-b/directory/containing/whl/file/"

But none of them worked.

EDIT 1:

This is my Dockerfile:

FROM python:2.7.9MAINTAINER Zeinab AbbasimazarADD myprojectdir .RUN ls -la ${HOME}/myprojectdir/dependencyRUN pip --versionRUN pip install --global-option=build_ext --global-option="-L${HOME}/myprojectdir/dependency" mypackagename-mypackageversionWORKDIR .CMD python --version

This is the output of docker build -t myimagename .:

Sending build context to Docker daemon 4.096 kBStep 1 : FROM python:2.7.9 ---> 646fa5bbf55dStep 2 : MAINTAINER Zeinab Abbasimazar ---> d08f7cb9e985Step 2 : ADD myprojectdir . ---> 0e190b21a30bStep 3 : RUN ls -la ${HOME}/myprojectdir/dependencytotal 1740drwxr-sr-x 2 root staff    4096 Sep  6 11:58 .drwxr-sr-x 3 root staff    4096 Sep  6 11:58 ..-rw-r--r-- 1 root staff  454253 Sep  6 11:58 mypackagename-mypackageversion-py2-none-any.whl ---> d069986bd3b6Step 4 : RUN pip --versionpip 1.5.6 from /usr/lib/python2.7/dist-packages (python 2.7) ---> ddeccc833ea2Step 5 : RUN pip install --global-option=build_ext --global-option="-L${HOME}/myprojectdir/dependency" mypackagename-mypackageversionDownloading/unpacking mypackagename-mypackageversion  Could not find a version that satisfies the requirement mypackagename-mypackageversionCleaning up...No distributions matching the version for mypackagename-mypackageversionStoring debug log for failure in /root/.pip/pip.logThe command '/bin/sh -c pip install --global-option=build_ext --global-option="-L${HOME}/myprojectdir/dependency" mypackagename-mypackageversion' returned a non-zero code: 1

EDIT2:

The pip install /path/to/the/whl/file.whl completely works; but it's not what I want.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>