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

pip install fails unless cffi installed first and separately #27

Open
cbm755 opened this issue Jul 2, 2020 · 6 comments
Open

pip install fails unless cffi installed first and separately #27

cbm755 opened this issue Jul 2, 2020 · 6 comments

Comments

@cbm755
Copy link
Collaborator

cbm755 commented Jul 2, 2020

This fails:

pip3 install cffi pycparser jpegtran-cffi

This also fails:

pip3 install jpegtran-cffi

But this succeeds:

pip3 install cffi pycparser
pip3 install jpegtran-cffi

Because of this I cannot figure out how to put jpegtran-cffi into a requirements.txt.

Maybe something wrong with how cffi is specified as a dependency? See also #26 which mentions pip not working "out of the box"...

Here's the output on a fairly barebones Ubuntu 18.04 docker image:

# python3 -m pip install cffi jpegtran-cffi
Collecting cffi
  Downloading cffi-1.14.0-cp37-cp37m-manylinux1_x86_64.whl (400 kB)
     |████████████████████████████████| 400 kB 1.1 MB/s 
Collecting jpegtran-cffi
  Downloading jpegtran-cffi-0.5.2.tar.gz (138 kB)
     |████████████████████████████████| 138 kB 705 kB/s 
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ul9qq_v2/jpegtran-cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ul9qq_v2/jpegtran-cffi/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-py95kfzq
         cwd: /tmp/pip-install-ul9qq_v2/jpegtran-cffi/
    Complete output (11 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-ul9qq_v2/jpegtran-cffi/setup.py", line 5, in <module>
        import jpegtran.lib
      File "/tmp/pip-install-ul9qq_v2/jpegtran-cffi/jpegtran/__init__.py", line 1, in <module>
        from jpegtran.transform import JPEGImage
      File "/tmp/pip-install-ul9qq_v2/jpegtran-cffi/jpegtran/transform.py", line 5, in <module>
        import jpegtran.lib as lib
      File "/tmp/pip-install-ul9qq_v2/jpegtran-cffi/jpegtran/lib.py", line 10, in <module>
        from cffi import FFI
    ModuleNotFoundError: No module named 'cffi'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
@cbm755
Copy link
Collaborator Author

cbm755 commented Jul 2, 2020

Oops I didn't look at closed issues... I see #6 looks like this. But it does not appear to be solved, or perhaps has re-appeared on more modern pip?

cbm755 added a commit to plomgrading/jpegtran-cffi that referenced this issue Aug 21, 2020
maybe need to workaround Issue jbaiter#27.
cbm755 added a commit to plomgrading/jpegtran-cffi that referenced this issue Aug 23, 2020
I *think* this is the modern way to specify setup_requires...  Hopefully
this fixed Issue jbaiter#27.

The `cffi` parts of the toml file come from [1].

[1] pyca/cryptography#3548
@WillBrennan
Copy link

bump; just had the same issue again when installing from pip.

Looks like pip only goes up to 0.5.2 but you had version 0.6a1 in your setup.py when you made fixes 022aa33 and e9cb057. Is this issue now resolved?

@anton-brandl
Copy link

bump; Same issue :/
This happens to me even when first installing cffi

@cbm755
Copy link
Collaborator Author

cbm755 commented May 10, 2022

I'm not really using this library anymore but I still bundle it in my docker image: https://gitlab.com/plom/plom/-/blob/main/Dockerfile#L39
where this workaround seems to be still working for me:

pip install cffi pycparser
pip install jpegtran-cffi

@mbaksa
Copy link

mbaksa commented Jul 15, 2023

Those two pip lines of code don't work anymore:

pip install cffi pycparser
pip install jpegtran-cffi

With pip 23.2 i get an error:

Getting requirements to build wheel ... error
error: subprocess-exited-with-error

@toyg
Copy link

toyg commented Aug 13, 2023

Same problem for me. Using 3.11.4 built with (homebrew-provided) pyenv.

Collecting jpegtran-cffi
  Using cached jpegtran-cffi-0.5.2.tar.gz (138 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [27 lines of output]
      Traceback (most recent call last):
        File "/Users/toyg/.pyenv/versions/3.11.4/envs/conanscrape/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/toyg/.pyenv/versions/3.11.4/envs/conanscrape/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/toyg/.pyenv/versions/3.11.4/envs/conanscrape/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/wc/csdscxjx55n5wkft51130s2h0000gn/T/pip-build-env-wl0hfiog/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/wc/csdscxjx55n5wkft51130s2h0000gn/T/pip-build-env-wl0hfiog/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/wc/csdscxjx55n5wkft51130s2h0000gn/T/pip-build-env-wl0hfiog/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 488, in run_setup
          self).run_setup(setup_script=setup_script)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/wc/csdscxjx55n5wkft51130s2h0000gn/T/pip-build-env-wl0hfiog/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 5, in <module>
        File "/private/var/folders/wc/csdscxjx55n5wkft51130s2h0000gn/T/pip-install-9yxbto9t/jpegtran-cffi_1c4c581e2b564e7e9d13f302a68e5a92/jpegtran/__init__.py", line 1, in <module>
          from jpegtran.transform import JPEGImage
        File "/private/var/folders/wc/csdscxjx55n5wkft51130s2h0000gn/T/pip-install-9yxbto9t/jpegtran-cffi_1c4c581e2b564e7e9d13f302a68e5a92/jpegtran/transform.py", line 5, in <module>
          import jpegtran.lib as lib
        File "/private/var/folders/wc/csdscxjx55n5wkft51130s2h0000gn/T/pip-install-9yxbto9t/jpegtran-cffi_1c4c581e2b564e7e9d13f302a68e5a92/jpegtran/lib.py", line 10, in <module>
          from cffi import FFI
      ModuleNotFoundError: No module named 'cffi'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

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

5 participants