Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doker installation failed - numpy #345

Closed
Mesengeros opened this issue Jan 9, 2018 · 4 comments
Closed

Doker installation failed - numpy #345

Mesengeros opened this issue Jan 9, 2018 · 4 comments
Labels

Comments

@Mesengeros
Copy link

Hello
I tried to install bot on mac os through Doker easy intallations steps
I get following error about numpy during running the command "docker build -t freqtrade . "

I tried to install Ta-lib manually and numpy throuht pip with success but it didn't solve the problem if i rerun the script.

Please tell me what I'm doing wrong

Mac OS high sierra


Running setup.py bdist_wheel for arrow: started

Running setup.py bdist_wheel for arrow: finished with status 'done'

Stored in directory: /root/.cache/pip/wheels/65/7a/c9/7b9696913a210637999c4631370a79a7e8d95ebe7404183d4a

Running setup.py bdist_wheel for wrapt: started

Running setup.py bdist_wheel for wrapt: finished with status 'done'

Stored in directory: /root/.cache/pip/wheels/56/e1/0f/f7ccf1ed8ceaabccc2a93ce0481f73e589814cbbc439291345

Running setup.py bdist_wheel for TA-Lib: started

Running setup.py bdist_wheel for TA-Lib: finished with status 'error'

Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-_itl3v49/TA-Lib/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/tmpjiwcjzs4pip-wheel- --python-tag cp36:

Traceback (most recent call last):

File "<string>", line 1, in <module>

File "/tmp/pip-build-_itl3v49/TA-Lib/setup.py", line 65, in <module>

  import numpy

ModuleNotFoundError: No module named 'numpy'


Running setup.py clean for TA-Lib

Failed building wheel for TA-Lib

Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-_itl3v49/TA-Lib/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" clean --all:

Traceback (most recent call last):

File "<string>", line 1, in <module>

File "/tmp/pip-build-_itl3v49/TA-Lib/setup.py", line 65, in <module>

  import numpy

ModuleNotFoundError: No module named 'numpy'


Failed cleaning build dir for TA-Lib``

@gcarq
Copy link
Member

gcarq commented Jan 9, 2018

I can reproduce this on macOS, it fails while building the wheel. The container should still work fine, because it falls back to source code if there is no prebuilt wheel available (please correct me if I'm wrong). Nevertheless this should be fixed

EDIT: Thanks for reporting!

@gcarq gcarq added the Bug label Jan 9, 2018
@fedecaccia
Copy link

While installing I have a similar error, but is terminal:

sudo docker build -t freqtrade

Sending build context to Docker daemon 39.09MB
Step 1/11 : FROM python:3.6.2
---> 26acbad26a2c
Step 2/11 : RUN apt-get update && apt-get -y install build-essential && apt-get clean
---> Using cache
---> 397f7a461d75
Step 3/11 : WORKDIR ta-lib RUN ./configure && make && make install && cd .. && rm -rf ta-lib
Removing intermediate container ee04bb5bee1e
---> 04c781d4c7b3
Step 4/11 : ENV LD_LIBRARY_PATH /usr/local/lib
---> Running in 6da0917d7f70
Removing intermediate container 6da0917d7f70
---> 09651572a610
Step 5/11 : RUN mkdir /freqtrade
---> Running in f379761c8662
Removing intermediate container f379761c8662
---> 132a0b9c588e
Step 6/11 : WORKDIR /freqtrade
Removing intermediate container 5a4c101bc3a7
---> d62e88c761b2
Step 7/11 : COPY requirements.txt /freqtrade/
---> 6939fe3c97d6
Step 8/11 : RUN pip install -r requirements.txt
---> Running in 4acc4f6ac92d
Collecting python-bittrex==0.3.0 (from -r requirements.txt (line 1))
Downloading python-bittrex-0.3.0.tar.gz
Collecting SQLAlchemy==1.2.2 (from -r requirements.txt (line 2))
Downloading SQLAlchemy-1.2.2.tar.gz (5.5MB)
Collecting python-telegram-bot==9.0.0 (from -r requirements.txt (line 3))
Downloading python_telegram_bot-9.0.0-py2.py3-none-any.whl (292kB)
Collecting arrow==0.12.1 (from -r requirements.txt (line 4))
Downloading arrow-0.12.1.tar.gz (65kB)
Collecting cachetools==2.0.1 (from -r requirements.txt (line 5))
Downloading cachetools-2.0.1-py2.py3-none-any.whl
Collecting requests==2.18.4 (from -r requirements.txt (line 6))
Downloading requests-2.18.4-py2.py3-none-any.whl (88kB)
Collecting urllib3==1.22 (from -r requirements.txt (line 7))
Downloading urllib3-1.22-py2.py3-none-any.whl (132kB)
Collecting wrapt==1.10.11 (from -r requirements.txt (line 8))
Downloading wrapt-1.10.11.tar.gz
Collecting pandas==0.22.0 (from -r requirements.txt (line 9))
Downloading pandas-0.22.0-cp36-cp36m-manylinux1_x86_64.whl (26.2MB)
Collecting scikit-learn==0.19.1 (from -r requirements.txt (line 10))
Downloading scikit_learn-0.19.1-cp36-cp36m-manylinux1_x86_64.whl (12.4MB)
Collecting scipy==1.0.0 (from -r requirements.txt (line 11))
Downloading scipy-1.0.0-cp36-cp36m-manylinux1_x86_64.whl (50.0MB)
Collecting jsonschema==2.6.0 (from -r requirements.txt (line 12))
Downloading jsonschema-2.6.0-py2.py3-none-any.whl
Collecting numpy==1.14.0 (from -r requirements.txt (line 13))
Downloading numpy-1.14.0-cp36-cp36m-manylinux1_x86_64.whl (17.2MB)
Collecting TA-Lib==0.4.16 (from -r requirements.txt (line 14))
Downloading TA-Lib-0.4.16.tar.gz (715kB)
Collecting pytest==3.4.0 (from -r requirements.txt (line 15))
Downloading pytest-3.4.0-py2.py3-none-any.whl (188kB)
Collecting pytest-mock==1.6.3 (from -r requirements.txt (line 16))
Downloading pytest_mock-1.6.3-py2.py3-none-any.whl
Collecting pytest-cov==2.5.1 (from -r requirements.txt (line 17))
Downloading pytest_cov-2.5.1-py2.py3-none-any.whl
Collecting hyperopt==0.1 (from -r requirements.txt (line 18))
Downloading hyperopt-0.1.tar.gz (98kB)
Collecting networkx==1.11 (from -r requirements.txt (line 20))
Downloading networkx-1.11-py2.py3-none-any.whl (1.3MB)
Collecting tabulate==0.8.2 (from -r requirements.txt (line 21))
Downloading tabulate-0.8.2.tar.gz (45kB)
Collecting pymarketcap==3.3.158 (from -r requirements.txt (line 22))
Downloading pymarketcap-3.3.158.tar.gz
Collecting future>=0.16.0 (from python-telegram-bot==9.0.0->-r requirements.txt (line 3))
Downloading future-0.16.0.tar.gz (824kB)
Collecting certifi (from python-telegram-bot==9.0.0->-r requirements.txt (line 3))
Downloading certifi-2018.1.18-py2.py3-none-any.whl (151kB)
Collecting python-dateutil (from arrow==0.12.1->-r requirements.txt (line 4))
Downloading python_dateutil-2.6.1-py2.py3-none-any.whl (194kB)
Collecting chardet<3.1.0,>=3.0.2 (from requests==2.18.4->-r requirements.txt (line 6))
Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB)
Collecting idna<2.7,>=2.5 (from requests==2.18.4->-r requirements.txt (line 6))
Downloading idna-2.6-py2.py3-none-any.whl (56kB)
Collecting pytz>=2011k (from pandas==0.22.0->-r requirements.txt (line 9))
Downloading pytz-2018.3-py2.py3-none-any.whl (509kB)
Collecting attrs>=17.2.0 (from pytest==3.4.0->-r requirements.txt (line 15))
Downloading attrs-17.4.0-py2.py3-none-any.whl
Collecting py>=1.5.0 (from pytest==3.4.0->-r requirements.txt (line 15))
Downloading py-1.5.2-py2.py3-none-any.whl (88kB)
Collecting six>=1.10.0 (from pytest==3.4.0->-r requirements.txt (line 15))
Downloading six-1.11.0-py2.py3-none-any.whl
Collecting pluggy<0.7,>=0.5 (from pytest==3.4.0->-r requirements.txt (line 15))
Downloading pluggy-0.6.0.tar.gz
Requirement already satisfied: setuptools in /usr/local/lib/python3.6/site-packages (from pytest==3.4.0->-r requirements.txt (line 15))
Collecting coverage>=3.7.1 (from pytest-cov==2.5.1->-r requirements.txt (line 17))
Downloading coverage-4.5.1-cp36-cp36m-manylinux1_x86_64.whl (202kB)
Collecting nose (from hyperopt==0.1->-r requirements.txt (line 18))
Downloading nose-1.3.7-py3-none-any.whl (154kB)
Collecting pymongo (from hyperopt==0.1->-r requirements.txt (line 18))
Downloading pymongo-3.6.0-cp36-cp36m-manylinux1_x86_64.whl (378kB)
Collecting decorator>=3.4.0 (from networkx==1.11->-r requirements.txt (line 20))
Downloading decorator-4.2.1-py2.py3-none-any.whl
Collecting bs4==0.0.1 (from pymarketcap==3.3.158->-r requirements.txt (line 22))
Downloading bs4-0.0.1.tar.gz
Collecting lxml==4.1.1 (from pymarketcap==3.3.158->-r requirements.txt (line 22))
Downloading lxml-4.1.1-cp36-cp36m-manylinux1_x86_64.whl (5.6MB)
Collecting beautifulsoup4 (from bs4==0.0.1->pymarketcap==3.3.158->-r requirements.txt (line 22))
Downloading beautifulsoup4-4.6.0-py3-none-any.whl (86kB)
Building wheels for collected packages: python-bittrex, SQLAlchemy, arrow, wrapt, TA-Lib, hyperopt, tabulate, pymarketcap, future, pluggy, bs4
Running setup.py bdist_wheel for python-bittrex: started
Running setup.py bdist_wheel for python-bittrex: finished with status 'done'
Stored in directory: /root/.cache/pip/wheels/6e/68/fb/6e1249ec5f1e2191746c2053be76111b1a64e0365a09a62433
Running setup.py bdist_wheel for SQLAlchemy: started
Running setup.py bdist_wheel for SQLAlchemy: finished with status 'done'
Stored in directory: /root/.cache/pip/wheels/1a/82/00/91a123a38de796ba3e559f837be5ac5d429afe5c7cd3ef2220
Running setup.py bdist_wheel for arrow: started
Running setup.py bdist_wheel for arrow: finished with status 'done'
Stored in directory: /root/.cache/pip/wheels/8b/f0/11/a675889f0f47d50ace5f8e1015c138c10a90e50327078710fd
Running setup.py bdist_wheel for wrapt: started
Running setup.py bdist_wheel for wrapt: finished with status 'done'
Stored in directory: /root/.cache/pip/wheels/56/e1/0f/f7ccf1ed8ceaabccc2a93ce0481f73e589814cbbc439291345
Running setup.py bdist_wheel for TA-Lib: started
Running setup.py bdist_wheel for TA-Lib: finished with status 'error'
Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-8macd39q/TA-Lib/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/tmpqhjj374lpip-wheel- --python-tag cp36:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-8macd39q/TA-Lib/setup.py", line 65, in
import numpy
ModuleNotFoundError: No module named 'numpy'


Failed building wheel for TA-Lib
Running setup.py clean for TA-Lib
Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-8macd39q/TA-Lib/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" clean --all:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-8macd39q/TA-Lib/setup.py", line 65, in
import numpy
ModuleNotFoundError: No module named 'numpy'


Failed cleaning build dir for TA-Lib
Running setup.py bdist_wheel for hyperopt: started
Running setup.py bdist_wheel for hyperopt: finished with status 'done'
Stored in directory: /root/.cache/pip/wheels/4b/0f/9d/1166e48523d3bf7478800f250b0fceae31ac6a08b8a7cca820
Running setup.py bdist_wheel for tabulate: started
Running setup.py bdist_wheel for tabulate: finished with status 'done'
Stored in directory: /root/.cache/pip/wheels/7c/fc/c4/f89c90e8bb6a0052a4ad4a9bc30a61429fea5d3439c63e2efd
Running setup.py bdist_wheel for pymarketcap: started
Running setup.py bdist_wheel for pymarketcap: finished with status 'done'
Stored in directory: /root/.cache/pip/wheels/88/5f/a1/8b4b6f0c4cbf39cbf7ac2cea056f27f51ff07132cfa1d9dbe1
Running setup.py bdist_wheel for future: started
Running setup.py bdist_wheel for future: finished with status 'done'
Stored in directory: /root/.cache/pip/wheels/c2/50/7c/0d83b4baac4f63ff7a765bd16390d2ab43c93587fac9d6017a
Running setup.py bdist_wheel for pluggy: started
Running setup.py bdist_wheel for pluggy: finished with status 'done'
Stored in directory: /root/.cache/pip/wheels/df/44/8e/e136760ae525eac46b3e3db643ef58ff1753177b5a722b0c96
Running setup.py bdist_wheel for bs4: started
Running setup.py bdist_wheel for bs4: finished with status 'done'
Stored in directory: /root/.cache/pip/wheels/84/67/d4/9e09d9d5adede2ee1c7b7e8775ba3fbb04d07c4f946f0e4f11
Successfully built python-bittrex SQLAlchemy arrow wrapt hyperopt tabulate pymarketcap future pluggy bs4
Failed to build TA-Lib
Installing collected packages: certifi, chardet, urllib3, idna, requests, python-bittrex, SQLAlchemy, future, python-telegram-bot, six, python-dateutil, arrow, cachetools, wrapt, pytz, numpy, pandas, scikit-learn, scipy, jsonschema, TA-Lib, attrs, py, pluggy, pytest, pytest-mock, coverage, pytest-cov, nose, pymongo, decorator, networkx, hyperopt, tabulate, beautifulsoup4, bs4, lxml, pymarketcap
Running setup.py install for TA-Lib: started
Running setup.py install for TA-Lib: finished with status 'error'
Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-8macd39q/TA-Lib/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-cxfassbs-record/install-record.txt --single-version-externally-managed --compile:
/tmp/pip-build-8macd39q/TA-Lib/setup.py:82: UserWarning: Cannot find ta-lib library, installation may fail.
warnings.warn('Cannot find ta-lib library, installation may fail.')
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/talib
copying talib/test_stream.py -> build/lib.linux-x86_64-3.6/talib
copying talib/abstract.py -> build/lib.linux-x86_64-3.6/talib
copying talib/init.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_abstract.py -> build/lib.linux-x86_64-3.6/talib
copying talib/deprecated.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_data.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_func.py -> build/lib.linux-x86_64-3.6/talib
copying talib/stream.py -> build/lib.linux-x86_64-3.6/talib
running build_ext
building 'talib._ta_lib' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/talib
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/lib/python3.6/site-packages/numpy/core/include -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/usr/local/include/python3.6m -c talib/_ta_lib.c -o build/temp.linux-x86_64-3.6/talib/_ta_lib.o
talib/_ta_lib.c:526:28: fatal error: ta-lib/ta_defs.h: No such file or directory
#include "ta-lib/ta_defs.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1

----------------------------------------

Command "/usr/local/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-8macd39q/TA-Lib/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-cxfassbs-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-8macd39q/TA-Lib/
The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1

@xmatthias
Copy link
Member

xmatthias commented Mar 15, 2018

Technically, i think this is a pip bug more than it is a bug with freqtrade.
By installing numpy first, and only then the requirements.txt, the error will not appear.
However - the error does not cause a failure or problems with ta-lib.

pip install numpy
pip install -r requirements.txt

or in case of docker

RUN pip install numpy
RUN pip install -r requirements.txt

Doing this can cause numpy to be reinstalled if the version installed first does not match the one in the requirements.txt.

I don't think this should be fixed in the context of the freqtrade bot.

@shusso
Copy link
Member

shusso commented Mar 25, 2018

Feel free to re-open if the problem was not fixed 👍

@shusso shusso closed this as completed Mar 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants