imodpasteur/lutorpy

maybe something useful to add to the install instructions

markmuir87 opened this issue · 11 comments

It's possible I'm just a little thick, but I spent the last 10 minutes scratching my head as to why setup.py was not picking up my TORCH_INSTALL env variable. Turns out I had forgotten that 'sudo' (using Arch, it might be aliased by default in Ubuntu) causes you to lose all of your environment variables and pick up root's.

Installing with 'sudo -E' solves this problem. Maybe worth including a one-liner in README.md, to help folks like me who are too lazy to create a virtualenv :)

Also, I've been searching for exactly this library, so can't wait to try it out!

oeway commented

Traceback (most recent call last):
File "", line 1, in
File "lutorpy/_ _ init_ _.py", line 10, in
assert not os.path.exists('./lutorpy/_lupa.pyx'), 'PLEASE DO NOT IMPORT LUTORPY FROM SOURCE CODE FOLDER.'
AssertionError: PLEASE DO NOT IMPORT LUTORPY FROM SOURCE CODE FOLDER.

lutorpy/_lupa.c:49:20: fatal error: Python.h: No such file or directory
#include "Python.h"
compilation terminated.
error: command 'gcc' failed with exit status 1

INSTALL env variable
Tried with "sudo -E" but still getting this error.

The directory '/home/mubarak/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/mubarak/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting lutorpy
Downloading https://files.pythonhosted.org/packages/dc/cd/86d3442cdd9fc0fefa0ee4662d1b07b665bc061b758061070972dcc447fc/lutorpy-1.3.7.tar.gz (210kB)
100% |████████████████████████████████| 215kB 996kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-BENolU/lutorpy/setup.py", line 32, in
assert 'torch' in luajit_path, 'failed to find torch luajit, please set env variable TORCH_INSTALL to torch/install'
AssertionError: failed to find torch luajit, please set env variable TORCH_INSTALL to torch/install

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

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-BENolU/lutorpy/

oeway commented

@engmubarak48 I have no idea what's going on exactly, have you tried to run TORCH_INSTALL=/your/torch/path pip sudo -E install lutorpy

@oeway tried this "TORCH_INSTALL=/home/mubarak/miniconda3/envs/face-clustering/lib/python3.6/site-packages/torch sudo -E pip install lutorpy", since your pip is at the wrong location. But, still not working

oeway commented

Hi, it seems you are using torch installed by conda, but we have never tested that.

Could you try to install torch according to the official website: http://torch.ch/docs/getting-started.html#_

@oeway I tried to enter my torch installation directory, and then executed sudo -E pip3 install lutorpy to indicate that the installation was successful, but when I "require" in the program, I still get an error. How can I solve it, or I understand the problem wrong. Hope to get help, thank you.

oeway commented

Hi, I don’t work on this for a while. Unfortunately this type of issue is hard to debug and varies by user’s os and environment. I am a bit busy at the moment, perhaps won’t have time to look into this, sorry.

ImportError: module 'setuptools.dist' has no attribute 'check_specifier'

i changed in setup.py

torch_install_dir = '/home/bob/distro/install'

that"s all! it's worked!