alpacahq/alpaca-backtrader-api

Unable to install library in container

cgd1 opened this issue · 3 comments

cgd1 commented

Hello,

I am looking to install inside a container running ubuntu 16.04 but I am getting an error.

Command used to install:
pip3 install alpaca-backtrader-api

Log output:

Collecting alpaca-backtrader-api
  Downloading alpaca-backtrader-api-0.7.1.tar.gz (16 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ogsm37zv/alpaca-backtrader-api_5c39332e0d974cfd99582129939ecdb4/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ogsm37zv/alpaca-backtrader-api_5c39332e0d974cfd99582129939ecdb4/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-hocfeg7h
         cwd: /tmp/pip-install-ogsm37zv/alpaca-backtrader-api_5c39332e0d974cfd99582129939ecdb4/
    Complete output (20 lines):
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    no previously-included directories found matching 'docs/build/'
    warning: install_lib: 'build/lib' does not exist -- no Python modules to install
    
    zip_safe flag not set; analyzing archive contents...
    
    Installed /tmp/pip-install-ogsm37zv/alpaca-backtrader-api_5c39332e0d974cfd99582129939ecdb4/.eggs/UNKNOWN-0.0.0-py3.5.egg
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-ogsm37zv/alpaca-backtrader-api_5c39332e0d974cfd99582129939ecdb4/setup.py", line 39, in <module>
        setup_requires=['pytest-runner', 'flake8'],
      File "/usr/lib/python3.5/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 269, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 313, in fetch_build_eggs
        replace_conflicting=True,
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 829, in resolve
        raise DistributionNotFound(req, requirers)
    pkg_resources.DistributionNotFound: The 'flake8' distribution was not found and is required by the application
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Service 'strategy_base_alpaca' failed to build: The command '/bin/sh -c pip3 install alpaca-backtrader-api' returned a non-zero code: 1
error Command failed with exit code 1.

I also attempted to install by cloning repo and:
python3 setup.py install

With no luck.

Any help would be greatly appreciated.

cgd1 commented

And container setup for reference:

# create x86 base image
FROM ubuntu:16.04 as strategy-base
# Update in order to install requirements
RUN apt update && apt upgrade
RUN apt install -y curl unzip git
# Install node and yarn
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt update && apt install -y yarn nodejs

# Install Python2 package manager
#RUN apt install -y python-pip && pip install --upgrade pip

RUN apt install -y python3-pip && pip3 install --upgrade pip
# Install Python3 package manager

RUN pip3 install backtrader
# Clean base image before finishing imagebuild
RUN apt clean && apt autoremove

FROM strategy-base as strategy-base-alpaca
RUN pip3 install alpaca-backtrader-api 

Hi, what is your python version? looks like you're using 3.5? try using 3.6

cgd1 commented

Hi @shlomikushchi thank you for spotting my error !! Much appreciated :) 👍