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

Error when pip installing lstchain #405

Closed
morcuended opened this issue May 11, 2020 · 8 comments
Closed

Error when pip installing lstchain #405

morcuended opened this issue May 11, 2020 · 8 comments

Comments

@morcuended
Copy link
Member

I tried to install lstchain with pip but it complained of a versioning-related errors

$ pip install lstchain
Collecting lstchain
  Using cached lstchain-0.5.0.tar.gz (120 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /home/dmorcuende/.local/miniconda3/envs/py37/bin/python /home/dmorcuende/.local/miniconda3/envs/py37/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpd_zq6g82
       cwd: /tmp/pip-install-6krz4e5t/lstchain
  Complete output (16 lines):
  Traceback (most recent call last):
    File "/home/dmorcuende/.local/miniconda3/envs/py37/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 257, in <module>
      main()
    File "/home/dmorcuende/.local/miniconda3/envs/py37/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 240, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/home/dmorcuende/.local/miniconda3/envs/py37/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 91, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/pip-build-env-i2aezbz7/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 148, in get_requires_for_build_wheel
      config_settings, requirements=['wheel'])
    File "/tmp/pip-build-env-i2aezbz7/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 128, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-i2aezbz7/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 143, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 10, in <module>
      from version import get_version, update_release_version  # noqa
  ModuleNotFoundError: No module named 'version'
  ----------------------------------------
ERROR: Command errored out with exit status 1: /home/dmorcuende/.local/miniconda3/envs/py37/bin/python /home/dmorcuende/.local/miniconda3/envs/py37/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpd_zq6g82 Check the logs for full command output.
@rlopezcoto
Copy link
Contributor

shouldn't it be:
from .version import get_version, update_release_version @maxnoe ?

from version import get_version, update_release_version # noqa

@maxnoe
Copy link
Member

maxnoe commented May 11, 2020

No. I think the error is that rhe version.py file is not included in the sdist.

I will check and we can just upload a 0.5.0.post1 to pypi when we have a fix

@maxnoe
Copy link
Member

maxnoe commented May 11, 2020

see #407

@maxnoe maxnoe closed this as completed in 5cc9864 May 12, 2020
@maxnoe
Copy link
Member

maxnoe commented May 12, 2020

0.5.0.post1 is on pypi and I tested that the installation works and provides the correct version

@morcuended
Copy link
Member Author

I tried again, first it complained about cython:

(py37) dmorcuende@argos:~$ pip install lstchain
Collecting lstchain
  Downloading lstchain-0.5.0.post1.tar.gz (120 kB)
     |████████████████████████████████| 120 kB 5.0 MB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: matplotlib in ./.local/miniconda3/envs/py37/lib/python3.7/site-packages (from lstchain) (3.2.1)
Requirement already satisfied: ctaplot~=0.5.2 in ./.local/miniconda3/envs/py37/lib/python3.7/site-packages (from lstchain) (0.5.2)
Collecting gammapy>=0.17
  Downloading gammapy-0.17.tar.gz (2.0 MB)
     |████████████████████████████████| 2.0 MB 11.3 MB/s 
    ERROR: Command errored out with exit status 1:
     command: /home/dmorcuende/.local/miniconda3/envs/py37/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-myzp1rqt/gammapy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-myzp1rqt/gammapy/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 /tmp/pip-install-myzp1rqt/gammapy/pip-egg-info
         cwd: /tmp/pip-install-myzp1rqt/gammapy/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-myzp1rqt/gammapy/setup.py", line 14, in <module>
        from Cython.Build import cythonize
    ModuleNotFoundError: No module named 'Cython'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I installed cython in that environment and then lstchain pip installation worked fine.

@maxnoe
Copy link
Member

maxnoe commented May 12, 2020

That is actually an issue for gammapy, as gammapy failed to require cython for installing

@maxnoe
Copy link
Member

maxnoe commented May 12, 2020

gammapy/gammapy#2895

@maxnoe
Copy link
Member

maxnoe commented May 15, 2020

Will be fixed in the next gammapy release: gammapy/gammapy#2896

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants