qstrader icon indicating copy to clipboard operation
qstrader copied to clipboard

Problem in Installation

Open ravii-github opened this issue 7 years ago • 21 comments

Hi,

I wanted to try the QSTrader application. My environment details as below OS: Ubuntu Version: Ubuntu 14.04.5 LTS

First 4 commands (as below) worked without any problems mkdir -p ~/venv/qstraderp3 cd ~/venv/qstraderp3 virtualenv --no-site-packages -p /usr/bin/python3 . source ~/venv/qstraderp3/bin/activate

When I execute the next command pip install git+https://github.com/mhallsmoore/qstrader.git

I get the following and ends with an error Downloading/unpacking git+https://github.com/hallsmoore/qstrader.git Cloning https://github.com/hallsmoore/qstrader.git to /tmp/pip-rq7vfehj-build Cleaning up... Cannot find command 'git' Storing debug log for failure in /home/ubuntu/.pip/pip.log

May I understand the problem and help me with a solution.

Thanks

ravii-github avatar Feb 18 '17 10:02 ravii-github

Try

git clone https://github.com/hallsmoore/qstrader.git
cd qstrader
python setup.py install

femtotrader avatar Feb 18 '17 11:02 femtotrader

Thanks for the response. I tried the first command and got the below error remote: Repository not found. Note: I am in the directory ~/venv/qstraderp3

ravii-github avatar Feb 18 '17 11:02 ravii-github

I also tried the below $ pip install git+git://github.com/mhallsmoore/qstrader.git

Still ended up in error Command python setup.py egg_info failed with error code 1 in /home/ubuntu/venv/q straderp3/build/pandas Storing debug log for failure in /home/ubuntu/.pip/pip.log

ravii-github avatar Feb 18 '17 11:02 ravii-github

Sorry this is

git clone https://github.com/mhallsmoore/qstrader.git

femtotrader avatar Feb 18 '17 12:02 femtotrader

That worked but had errors in this command "python setup.py install"

Issue in installing numpy>=1.7.0 Error Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.

Followed the below steps 1 Executed "pip install git+https://bitbucket.org/pypy/numpy.git"" Failure RuntimeError: A PyPy interpreter is required Command python setup.py egg_info failed with error code 1 in /tmp/pip-8j5q0l9q-b uild

2 Executed "git clone https://bitbucket.org/pypy/numpy.git"" No eror Executed "Python setup.py install" Error fatal error: Python.h: No such file or directory

3 Executed "sudo apt-get install libpython2.7-dev python-numpy"" Error SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.

4 Executed "sudo apt-get install python3-dev" Error _configtest.c:1:20: fatal error: Python.h: No such file or directory

5 Executed "apt-get install python3-dev" Permission denied

6 Executed "sudo apt-get install python-dev No error

7 Executed "sudo apt-get install python3-dev" No error

8 Executed "Python setup.py install" fatal error: npy_math_common.h: No such file or directory

9 Executed "sudo apt-get remove python-virtualenv" Executed "sudo pip install virtualenv"

10 Executed "Python setup.py install" fatal error: npy_math_private.h: No such file or directory

Finally struck at this point. Need help to proceed further.

Attached the full log MobaXterm_ec2-54-251-179-139.ap-southeast-1.compute.amazonaws.comubuntu_20170219_132202.docx

ravii-github avatar Feb 19 '17 02:02 ravii-github

Any help !!

ravii-github avatar Feb 20 '17 09:02 ravii-github

Hi Ravii,

Can you let me know exactly how you installed Python/virtualenv initially on your Ubuntu setup, prior to attempting to install QSTrader? I'm also using 14.04 LTS.

Cheers,

Mike.

mhallsmoore avatar Feb 20 '17 10:02 mhallsmoore

Hi Mike, In this version of Ubuntu, python was pre installed. Virtual env was setup using the below command virtualenv --no-site-packages -p /usr/bin/python3 .

Let me know if I missed anything

ravii-github avatar Feb 20 '17 10:02 ravii-github

Hi Ravii,

I think I had a similar issue a while back and I fixed it by trying this: virtualenv --no-site-packages -p python3 .

i.e. remove the /usr/bin from the latter -p option. Try it in a new virtualenv directory and see what happens.

Perhaps before trying to install QSTrader (but once you've tried the new virtualenv command), see if you can simply install

pip install numpy

If you can get NumPy compiled, then we're probably halfway there!

Cheers,

Mike.

mhallsmoore avatar Feb 20 '17 11:02 mhallsmoore

Thanks Mike,

Both worked. When I installed numpy I got the below message "Requirement already satisfied (use --upgrade to upgrade): numpy in /usr/lib/python2.7/dist-packages"

I am planning to install qstrader3

ravii-github avatar Feb 20 '17 12:02 ravii-github

I got the below error while installing qstrader3 [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/test-easy-install-18829.write-test' Seems like its on version 2.7 of python. Should I upgrade ?

ravii-github avatar Feb 20 '17 13:02 ravii-github

Hi, Any help ?

ravii-github avatar Feb 24 '17 03:02 ravii-github

@ravii-github You might have just needed sudo on the command ? As it sounds like a permissions issue

ryankennedyio avatar Feb 26 '17 20:02 ryankennedyio

@ryankennedyio Thanks mate. That worked and command executed successfully.

When I executed the next one pip install -r https://raw.githubusercontent.com/mhallsmoore/qstrader/master/requirements.txt I got the below error Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib

What does this mean ?

Thanks

ravii-github avatar Mar 14 '17 19:03 ravii-github

I got the issue resolved by the following command sudo apt-get install libfreetype6-dev libxft-dev

However when I tried to execute the backtest with the command python buy_and_hold_backtest.py

I got the below error ImportError: No module named click

Pls help

ravii-github avatar Mar 14 '17 20:03 ravii-github

click seems to be a package on pypi https://pypi.python.org/pypi/click . You can try issuing the following:

sudo pip install click

On Tue, Mar 14, 2017 at 4:17 PM, ravii-github [email protected] wrote:

I got the issue resolved by the following command sudo apt-get install libfreetype6-dev libxft-dev

However when I tried to execute the backtest with the command python buy_and_hold_backtest.py

I got the below error ImportError: No module named click

Pls help

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mhallsmoore/qstrader/issues/180#issuecomment-286546395, or mute the thread https://github.com/notifications/unsubscribe-auth/AHL__9gxleviCmCzlwRG7eiRMRXqIlsKks5rlvXsgaJpZM4MFFFC .

-- Best Regards,

Brenton Zillins Software Engineer 754-273-6866

bzillins avatar Mar 14 '17 20:03 bzillins

@bzillins Thanks, installed that package.

Now, I am missing the module "munch" referred in the file settings.py I cant locate the folder as mentioned in line 5 from munch import munchify, unmunchify

ravii-github avatar Mar 14 '17 22:03 ravii-github

@ravii-github Munch is another package on pypi https://pypi.python.org/pypi/munch/ Use the same method as you used for Click.

wanageeska avatar Mar 14 '17 22:03 wanageeska

@wanageeska Thanks. I also installed the packages enum and multipledispatch along with Munch.

But, when I tried to install "buy_and_hold" i have the below error

Could not find any downloads that satisfy the requirement buy-and-hold Cleaning up... No distributions at all found for buy-and-hold

ravii-github avatar Mar 14 '17 23:03 ravii-github

@ravii-github I'm not sure I understand what you mean by installing 'buy-and-hold'. I'm assuming you have tried to pip install. This is not required. The last I checked, 'buy-and-hold-backtest.py' is a sample script contained within the qstrader repo. Provided you have all of the dependencies installed as per the requirements.txt, you can then run the sample strategies from the command line, eg:

python buy_and_hold_backtest.py

The other sample strategies can be run in the same way, eg:

python moving-average-cross-backtest.py

The readme outlines the required steps in more detail.

wanageeska avatar Mar 15 '17 01:03 wanageeska

@wanageeska When I tried "python buy_and_hold_backtest.py", I got the error ImportError: No module named buy_and_hold

I just assumed it could be another module and tried the same as Munch. Now I understand However I could see necessary files in the "strategy" folder. Not sure what is wrong.

But I dont see any files with the name "moving-average-cross-backtest.py"

ravii-github avatar Mar 15 '17 02:03 ravii-github