quantstart / qstrader

QSTrader
MIT License
126 stars 54 forks source link

Installation Error #7

Open wolfcuring opened 5 years ago

wolfcuring commented 5 years ago

Hi QStraders,

I followed the exact commands to install the QStrader on a Unbuntu 18.04. While it kept throwing out the following Errors:

ERROR: Command errored out with exit status 1: /home/warren/venv/qstraderp3/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-b4inkf/numpy/setup.py'"'"'; file='"'"'/tmp/pip-install-b4inkf/numpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-6b5v_rs3/install-record.txt --single-version-externally-managed --compile --install-headers /home/warren/venv/qstraderp3/include/site/python3.7/numpy Check the logs for full command output.

Do not know what is going on here, any suggestion ?

Best, Warren.

TechnoConserve commented 5 years ago

What was the command you used that threw the error?

wolfcuring commented 5 years ago

thank you for the reply, it is the last command in the installation:

(qstraderp3)$ pip install -r https://raw.githubusercontent.com/quantstart/qstrader/master/requirements.txt

TechnoConserve commented 5 years ago

I'm not sure of the exact issue, but it's very likely that the installation is failing because you don't have all of the prerequisites installed on your machine.

It might be easiest to install scipy and numpy using your package manager so it can handle all of the dependencies:

sudo apt install python3-numpy python3-scipy

At that point you might be good to go. Just run your pip install command again to see if succeeds. If you run into more errors complaining about blas or lapack you can install them like so:

sudo apt-get install libblas3 liblapack3 liblapack-dev libblas-dev

And lastly, if you run into an error complaining about a missing fortran compiler, install this:

sudo apt-get install gfortran

P.S. Unfortunately, this project seems kind of dead so don't get your hopes up too high about using it...

onshek commented 5 years ago

The code has not been updated for a long time, so there may be conflicts between packages in the requirements.txt. The simplest way is to remove all version restrictions in it. BTW, some of these packages may need to use conda install.

wolfcuring commented 5 years ago

@TechnoConserve @onshek
Thank you for your reply. I once tried to install it under an Anaconda env but it seemed to have conflicts of versions or something.

Thanks for your suggestion, I am installing it, because I want to familiarize with python as there is book out there on QStrading.

SulfredLee commented 5 years ago

@wolfcuring Hello. I am using ubuntu 19.04. I am installing this library and failed while Building wheel for numpy.

ERROR: Command errored out with exit status 1:
   command: ~/qstraderp3/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-nri_knr7/numpy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-nri_knr7/numpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-34yui3_f --python-tag cp37
       cwd: /tmp/pip-install-nri_knr7/numpy/

I have already tried

sudo apt install python3-numpy python3-scipy
sudo apt-get install libblas3 liblapack3 liblapack-dev libblas-dev
sudo apt-get install gfortran

Do you install the library successfully? Would you mind to provide more details?

Thank you very much.

TechnoConserve commented 5 years ago

I managed to get it installed with the commands above using Mint 19.2 which is a derivative of Ubuntu 18.04.

I would suggest trying to install numpy alone in a virtual environment so you can work out what's preventing numpy from installing correctly.

SulfredLee commented 5 years ago

@TechnoConserve

Thank you very much. I have tried but the error still there, I will see if there is another way. Thank you.