iSeeBetter icon indicating copy to clipboard operation
iSeeBetter copied to clipboard

Trouble with installation: requirements.txt complains and pyfow fails

Open moldach opened this issue 3 years ago • 1 comments

I'm running into errors with the installation of pyflow:

(venv) [moldach@beluga4 pyflow]$ python setup.py build_ext -i
running build_ext
building 'pyflow' extension
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/scratch/moldach/iSeeBetter/venv/lib64/python3.6/site-packages/numpy/core/include -I/scratch/moldach/iSeeBetter/venv/lib64/python3.6/site-packages/numpy/core/include -I/scratch/moldach/iSeeBetter/venv/include -I/usr/include/python3.6m -c pyflow.cpp -o build/temp.linux-x86_64-3.6/pyflow.o
pyflow.cpp:29:10: fatal error: Python.h: No such file or directory
 #include "Python.h"
          ^~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
(venv) [moldach@beluga4 pyflow]$ 

pip freeze

Actually the problem beings right-out-of-the-gate as when I created a python virtual env with version 3.6.3 and tried to run pip3 install -r requirements.txt there were errors for the specific versions listed because the distributions cannot be found (_commented out):

#torch==1.3.0.post2
torch
pytorch-ssim==0.1
#numpy==1.16.4
numpy
#scikit-image==0.15.0
scikit-image
tqdm==4.37.0

For example,

(venv) [moldach@beluga4 iSeeBetter]$ pip3 install torch==1.3.0.post2
Looking in links: /cvmfs/soft.computecanada.ca/custom/python/wheelhouse/nix/avx512, /cvmfs/soft.computecanada.ca/custom/python/wheelhouse/nix/avx2, /cvmfs/soft.computecanada.ca/custom/python/wheelhouse/nix/generic, /cvmfs/soft.computecanada.ca/custom/python/wheelhouse/generic
ERROR: Could not find a version that satisfies the requirement torch==1.3.0.post2
ERROR: No matching distribution found for torch==1.3.0.post2

So the environment looks like:

(venv) [moldach@beluga4 iSeeBetter]$ pip freeze
DEPRECATION: --find-links option in pip freeze is deprecated. pip 21.2 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/9069.
-f /cvmfs/soft.computecanada.ca/custom/python/wheelhouse/nix/avx512
-f /cvmfs/soft.computecanada.ca/custom/python/wheelhouse/nix/avx2
-f /cvmfs/soft.computecanada.ca/custom/python/wheelhouse/nix/generic
-f /cvmfs/soft.computecanada.ca/custom/python/wheelhouse/generic
alabaster==0.7.12
appdirs==1.4.4
astor==0.8.1
attrs==20.3.0
autoflake==1.4
Babel==2.9.0
bandit==1.7.0
black==20.8b1
certifi==2020.12.5
chardet==4.0.0
click==7.1.2
coverage==5.5
cycler==0.10.0
Cython==0.29.22
darglint==1.7.0
dataclasses==0.8
distlib==0.3.1
doc8==0.8.1
docutils==0.16
eradicate==1.0
ez-setup==0.9
filelock==3.0.12
flake8==3.9.0
flake8-2020==1.6.0
flake8-bandit==2.1.0
flake8-broken-line==0.2.1
flake8-bugbear==19.8.0
flake8-builtins==1.5.3
flake8-commas==2.0.0
flake8-comprehensions==3.4.0
flake8-debugger==3.2.0
flake8-docstrings==1.6.0
flake8-eradicate==0.3.0
flake8-fixme==1.1.1
flake8-isort==3.0.1
flake8-logging-format==0.6.0
flake8-mutable==1.2.0
flake8-polyfill==1.0.2
flake8-quotes==2.1.2
flake8-rst-docstrings==0.0.12
flake8-string-format==0.2.3
flake8-variables-names==0.0.3
gitdb==4.0.5
GitPython==3.1.14
idna==2.10
imagesize==1.2.0
importlib-metadata==3.7.3
importlib-resources==5.1.2
iniconfig==1.1.1
isort==4.3.21
Jinja2==2.11.3
kiwisolver==1.3.1
libpython==0.2
MarkupSafe==1.1.1
matplotlib==3.3.2
mccabe==0.6.1
mypy-extensions==0.4.3
numpy==1.19.1
packaging==20.9
pathspec==0.8.1
pbr==5.5.1
pep8-naming==0.9.1
Pillow==7.2.0
pluggy==0.13.1
py==1.10.0
pycodestyle==2.7.0
pydocstyle==5.1.1
pyflakes==2.3.0
Pygments==2.8.1
pyparsing==2.4.7
pytest==6.2.2
pytest-cov==2.11.1
python-dateutil==2.8.1
python-dev-tools==2020.9.10
pytz==2021.1
pyupgrade==2.11.0
PyYAML==5.3.1
regex==2020.11.13
requests==2.25.1
restructuredtext-lint==1.3.2
six==1.15.0
smmap==3.0.5
snowballstemmer==2.1.0
Sphinx==2.4.4
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==1.0.3
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.4
stevedore==3.3.0
testfixtures==6.17.1
tokenize-rt==4.1.0
toml==0.10.2
tox==3.23.0
tox-travis==0.12
typed-ast==1.4.1
typing-extensions==3.7.4.3
urllib3==1.26.4
virtualenv==20.4.3
wemake-python-styleguide==0.14.1
zipp==3.4.1

moldach avatar Mar 22 '21 17:03 moldach

I'm currently experiencing the same issue, except I'm stuck on the torch==1.3.0.post2 part. It seems that the installation will only work for MacOS users, as seen when looking under the files tab of the torch 1.3.0.post2 PyPi page.

Update If you're on Linux, try out rylezhou's fork or theotime-dugois' fork (I haven't tested either, but they seems promising). If you're on Windows, try out Konlador's fork. Note that Konlador's fork hasn't updated the README but procedure should be the same as the current one.

Additionally, on Windows, you may run into issues installing PyFlow. Use philferriere's fork instead.

Rhinozz avatar Jul 04 '21 01:07 Rhinozz