pytorch-lightning: Install within conda env breaks
Describe the bug Installation inside conda environment fails on Mac and Linux with the following message
ERROR: Command errored out with exit status 1:
command: /Users/dsuess/Library/Conda/envs/test/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/ky/6gq9n6md77n0y3hsf37_b6qr0000gn/T/pip-install-8izjxcqp/pytorch-lightning/setup.py'"'"'; __file__='"'"'/private/var/folders/ky/6gq9n6md77n0y3hsf37_b6qr0000gn/T/pip-install-8izjxcqp/pytorch-lightning/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 pip-egg-info
cwd: /private/var/folders/ky/6gq9n6md77n0y3hsf37_b6qr0000gn/T/pip-install-8izjxcqp/pytorch-lightning/
Complete output (3 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'setuptools'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Running python -c 'import setuptools' does not fail, so setuptools is installed. Also, installing directly from github is fine. I think it’s due to the site directory inside the tarball from pypi breaking python
To Reproduce
conda create --name test python=3
conda activate test
python -m pip install pytorch-lightning
Expected behavior The package should be installed succesfully
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: MacOS 10.14.6 and Ubuntu 18.04
- conda 4.7.11
- pip 19.2.3
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 26 (21 by maintainers)
Since PL depends on pytorch, we can’t push PL to conda forge because pytorch is available via a separate conda channel called
pytorch.I had a good time installing from git directly. Pretty hacky, but worked:
See https://github.com/PyTorchLightning/pytorch-lightning/pull/898
Thanks for your help, turns out it was a PYTHONPATH issue. I had set PYTHONPATH to
some/directory:. Due to the:at the end, the current working directory is added tosys.path, which in turn breaks the installation due to thesitedirectory. This was on both, my Mac and Linux box.