shchur/tpp-anomaly-detection

Problems with wheels for Python 3.9

rafael-glima opened this issue · 3 comments

Greetings,

I am trying to set up the env with the yml file and I keep getting fails related to wheels. I looked for some solutions online and found some comments on downgrading from Python 3.9 to 3.8 to make it work. Would doing that to the packages in the environment.yml file significantly affect your code?

Best regards,

Hi, I guess that everything should work fine with Python 3.8 as well. Let me know if you encounter any problems.

By the way, can you please share the command that you use for installation and the error message that you get?

Hi, I am running the command "conda env create -f environment.yml", as in the documentation, in a laptop with Ubuntu 20.04

The error message is as below (the fix for tick library is already in the official github repo):

Building wheels for collected packages: tick
Building wheel for tick (setup.py): started
Building wheel for tick (setup.py): finished with status 'error'
Running setup.py clean for tick
Failed to build tick
Installing collected packages: urllib3, pyasn1, jinja2, idna, charset-normalizer, rsa, requests, pyasn1-modules, oauthlib, multidict, frozenlist, cachetools, yarl, sphinxcontrib-serializinghtml, sphinxcontrib-qthelp, sphinxcontrib-jsmath, sphinxcontrib-htmlhelp, sphinxcontrib-devhelp, sphinxcontrib-applehelp, snowballstemmer, requests-oauthlib, imagesize, google-auth, docutils, babel, async-timeout, alabaster, aiosignal, werkzeug, tensorboard-plugin-wit, tensorboard-data-server, sphinx, pyyaml, protobuf, markdown, jupyter-contrib-core, grpcio, google-auth-oauthlib, fsspec, aiohttp, absl-py, tqdm, torchmetrics, tensorboard, pydeprecate, numpydoc, lxml, jupyter-nbextensions-configurator, jupyter-latex-envs, jupyter-highlight-selected-word, future, tick, pytorch-lightning, jupyter-contrib-nbextensions, dill
Attempting uninstall: jinja2
Found existing installation: Jinja2 3.0.2
Uninstalling Jinja2-3.0.2:
Successfully uninstalled Jinja2-3.0.2
Running setup.py install for tick: started
Running setup.py install for tick: finished with status 'error'

Pip subprocess error:
ERROR: Command errored out with exit status 1:
command: /home/rafael/anaconda3/envs/anomaly_tpp/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-x8r8od_x/tick_7ad77c24dfac4f5eb597ed1c061875af/setup.py'"'"'; file='"'"'/tmp/pip-install-x8r8od_x/tick_7ad77c24dfac4f5eb597ed1c061875af/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-nk3ceux_
cwd: /tmp/pip-install-x8r8od_x/tick_7ad77c24dfac4f5eb597ed1c061875af/
Complete output (4 lines):
Error executing check_mkl.py - mkl not found
running bdist_wheel
running build
error: [Errno 2] No such file or directory: 'swig'

ERROR: Failed building wheel for tick
ERROR: Command errored out with exit status 1:
command: /home/rafael/anaconda3/envs/anomaly_tpp/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-x8r8od_x/tick_7ad77c24dfac4f5eb597ed1c061875af/setup.py'"'"'; file='"'"'/tmp/pip-install-x8r8od_x/tick_7ad77c24dfac4f5eb597ed1c061875af/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-y9vw6vbr/install-record.txt --single-version-externally-managed --compile --install-headers /home/rafael/anaconda3/envs/anomaly_tpp/include/python3.9/tick
cwd: /tmp/pip-install-x8r8od_x/tick_7ad77c24dfac4f5eb597ed1c061875af/
Complete output (7 lines):
Error executing check_mkl.py - mkl not found
running install
running build_ext
building 'tick.array.build._array' extension
swigging lib/swig/tick/array/array_module.i to lib/swig/tick/array/array_module_wrap.cpp
swig -python -py3 -c++ -Ilib/swig -Ilib/include -outdir tick/array/build -DDEBUG_COSTLY_THROW -o lib/swig/tick/array/array_module_wrap.cpp lib/swig/tick/array/array_module.i
error: command 'swig' failed: No such file or directory
----------------------------------------
ERROR: Command errored out with exit status 1: /home/rafael/anaconda3/envs/anomaly_tpp/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-x8r8od_x/tick_7ad77c24dfac4f5eb597ed1c061875af/setup.py'"'"'; file='"'"'/tmp/pip-install-x8r8od_x/tick_7ad77c24dfac4f5eb597ed1c061875af/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-y9vw6vbr/install-record.txt --single-version-externally-managed --compile --install-headers /home/rafael/anaconda3/envs/anomaly_tpp/include/python3.9/tick Check the logs for full command output.

CondaEnvException: Pip failed

I have updated environment.yml and README.md, now the installation should just work with a single command. Thanks a lot for pointing out this problem!

The problem was with the tick package — there was no wheel available for python 3.9, and compilation requires a few additional dependencies. Downgrading everythin to python 3.8 fixed the issue.