I'm currently working on a package and in my requirements.txt
, I have a dependency: wikipedia
. Now, wikipedia
1.3 uses requests-2.2.1
while my package uses version 2.3.0.
Also, as one would expect, wikipedia-1.3
's installation depends on presence of it's dependency.
But, If I start a new virtualenv and directly include wikipedia
in my requirements.txt
, it gives an ImportError
on requests
since at the time setup.py
runs, requests-2.3.0
's setup.py
doesn't execute unless all others execute. In the Figure attached below, there's no running setup.py
for requests
after it gets unpacked.
For some weird reason, wikipedia
's setup.py
contains import wikipedia
, which in turn imports it's dependencies before they're even installed; however it passes the CI test because it's installing requirements separately through pip and then running setup.py
.
To over come this situation, I've made a setup script consisting of:
pip install -r requirements.txt
pip install wikipedia
pip install -e .
- This installs
requests-2.3.0
andbeautifulsoup4
; - then installs
wikipedia
(which can then runsetup.py
and installswikipedia
andrequests-2.2.1
) - then 'pip install -e .' option installs my package along with
requests-2.3.0
again.
Hence requests-2.3.0
is first getting installed, then getting replaced by older version 2.2.1 and then replaced again by 2.3.0
.
I tried going through various specifications on how to overcome this but those were confusing. How could I overcome this mess?