4

I am trying to install list of packages from requirements.txt. However, even though I have numpy listed in the file, package tulipy is returning error ImportError: No module named 'numpy'. Please note, I still want to install the packages with one command, from file. Are there any workarounds for it?

My requirements.txt:

numpy>=1.14.1
Cython>=0.28.2
ccxt>=1.13.50
tulipy>=0.2.1
kb4145
  • 49
  • 1
  • 7

1 Answers1

2

Updated answer

numpy and Cython have to be installed prior to tulipy. To do this, you can install the packages in requirements.txt individually and in order. numpy and Cython must be above tulipy in the requirements file.

xargs -n1 pip install < requirements.txt

[taken from a previous stackoverflow answer]

Old answer

tulipy requires numpy to be installed. To work around this, first install numpy, and then install your requirements.txt file.

pip install numpy
pip install -r requirements.txt

As proof that tulipy requires numpy during installation, please take a look at tulipy's setup.py file.

jkr
  • 17,119
  • 2
  • 42
  • 68
  • So that meas the only solution is to run `pip install numpy` and then run `pip install -r requirements.txt`? Because if so, I will write a bash script to do it, since I want to install everything with one command. – kb4145 May 24 '18 at 13:13
  • @DJ_Tth3jtr - it seems that `pip` on its own cannot install numpy before tulipy. Please seem my edit. Something like that could be written in a bash script, but it is a one-liner. – jkr May 24 '18 at 13:27