0

I am unable to build docker image with Ubuntu as base OS for one of my projects written few months ago using Scrapy. Its showing following dependency error -

Downloading/unpacking cryptography>=2.1.4 (from pyOpenSSL->Scrapy==1.4.0->-r /app/requirements.txt (line 3))
  Running setup.py (path:/tmp/pip_build_root/cryptography/setup.py) egg_info for package cryptography
    error in cryptography setup command: Invalid environment marker: platform_python_implementation != 'PyPy'
    Complete output from command python setup.py egg_info:
    error in cryptography setup command: Invalid environment marker: platform_python_implementation != 'PyPy'

As I have no control over Scrapy's dependencies and I have been using Scrapy 1.4.0, latest release, alongwith Python 3, I am not sure what are my options now?

Following is the command I use to install the dependencies

pip3 install -r requirements.txt

Following is what my requirements.txt looks like

lxml==3.8.0
psycopg2==2.7.3.1
Scrapy==1.4.0
Twisted==17.5.0
validators==0.12.0
tweepy==3.5.0

Update:

The build goes fine on a Mac machine as shown below while it doesn't work on a Ubuntu machine. Note: Even a successful build does warn about platform_python_implementation != "PyPy" as shown below -

Collecting cffi>=1.7; platform_python_implementation != "PyPy" (from cryptography>=2.1.4->pyOpenSSL->Scrapy==1.4.0->-r requirements.txt (line 3))
  Downloading cffi-1.11.2-cp35-cp35m-macosx_10_6_intel.whl (240kB)
    100% |████████████████████████████████| 245kB 623kB/s
Collecting asn1crypto>=0.21.0 (from cryptography>=2.1.4->pyOpenSSL->Scrapy==1.4.0->-r requirements.txt (line 3))
  Downloading asn1crypto-0.23.0-py2.py3-none-any.whl (99kB)
    100% |████████████████████████████████| 102kB 830kB/s
Collecting pycparser (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography>=2.1.4->pyOpenSSL->Scrapy==1.4.0->-r requirements.txt (line 3))
Building wheels for collected packages: zope.interface, oauthlib
  Running setup.py bdist_wheel for zope.interface ... done
  Stored in directory: /Users/rahul/Library/Caches/pip/wheels/8b/39/98/0fcb72adfb12b2547273b1164d952f093f267e0324d58b6955
  Running setup.py bdist_wheel for oauthlib ... done
  Stored in directory: /Users/rahul/Library/Caches/pip/wheels/e5/46/f7/bb2fde81726295a13a71e3c6396d362ab408921c6562d6efc0
Successfully built zope.interface oauthlib
comiventor
  • 3,922
  • 5
  • 50
  • 77
  • 1
    it shows `PyPy` in error message - maybe you have to install `pypy` ? – furas Dec 12 '17 at 07:05
  • Maybe but I am not sure what changed in last few months as I haven't changed anything. How did it work without explicit pypy installation earlier? – comiventor Dec 12 '17 at 07:47
  • it shows that it tries to download `cryptography`. Maybe there is new version which uses `pypy`. – furas Dec 12 '17 at 07:49
  • @furas I just did a local build on my mac machine in a completely new virtualenv and everything worked fine although it did showed the message `platform_python_implementation != pypy` twice. – comiventor Dec 12 '17 at 08:06
  • are you installing that inside a `virtualenv`? – eLRuLL Dec 13 '17 at 06:02
  • yes I am using virtualenv on my local machine where build is successful. As opposed to that, I am getting the error shared in my post while building a Docker image for deployment. – comiventor Dec 13 '17 at 07:22
  • ok you never specified using docker on the question, please update that information and it is most definitely sure the configuration of that docker image. – eLRuLL Dec 13 '17 at 15:22
  • @eLRuLL updated the information my question – comiventor Dec 14 '17 at 18:15

1 Answers1

1

The issue was related to pip3 upgrade. One of the contributors to the package shared the tip here

vezunchik
  • 3,669
  • 3
  • 16
  • 25
comiventor
  • 3,922
  • 5
  • 50
  • 77