cernopendata / cernopendata-client

CERN Open Data command-line client
http://cernopendata-client.readthedocs.io/
GNU General Public License v3.0
10 stars 9 forks source link

pip3 installation fails looking for "curl-config" #78

Closed avivace closed 4 years ago

avivace commented 4 years ago

Environment: Python3.8, pip 19.2.3

Running pip install cernopendata-client gives:

    ERROR: Command errored out with exit status 1:
     command: /home/avivace/.local/share/virtualenvs/bagit-create-tuzAGD-s/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-he1mpu_d/pycurl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-he1mpu_d/pycurl/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-pip-egg-info-ej5txkkk
         cwd: /tmp/pip-install-he1mpu_d/pycurl/
    Complete output (22 lines):
    Traceback (most recent call last):
      File "/tmp/pip-install-he1mpu_d/pycurl/setup.py", line 236, in configure_unix
        p = subprocess.Popen((self.curl_config(), '--version'),
      File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
        raise child_exception_type(errno_num, err_msg, err_filename)
    FileNotFoundError: [Errno 2] No such file or directory: 'curl-config'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-he1mpu_d/pycurl/setup.py", line 988, in <module>
        ext = get_extension(sys.argv, split_extension_source=split_extension_source)
      File "/tmp/pip-install-he1mpu_d/pycurl/setup.py", line 649, in get_extension
        ext_config = ExtensionConfiguration(argv)
      File "/tmp/pip-install-he1mpu_d/pycurl/setup.py", line 101, in __init__
        self.configure()
      File "/tmp/pip-install-he1mpu_d/pycurl/setup.py", line 241, in configure_unix
        raise ConfigurationError(msg)
    __main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory: 'curl-config'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Maybe a paragraph in the README could also explain how to manually install this, not using pip?

tiborsimko commented 4 years ago

Hi @avivace, there are two takes on this:

1) Which OS you are using? You may need to install some system packages, e.g. for CentOS it is necessary to have libcurl-devel installed. (See our Dockerfile.)

2) People may be using cernopendata-client on many systems, so ideally we could take this occasion @ParthS007 and revive the old idea of making pycurl an optional dependency. That is, check if it is there, and if not, simply use requests or other such built-in mechanism for downloading files.

The item 1 is a quick fix for @avivace, the item 2 is more work, but perhaps worth to take already now?

avivace commented 4 years ago

Hi @tiborsimko and @ParthS007 and thanks for the troubleshooting!

I'm on Debian Sid. I've installed python-pycurl libcurl4-openssl-dev libssl-dev and that definitely fixed the issue, I'm now able to run the cernopendata-client executable from the shell.