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

Doesn't work on Python 3.12.0 #86

Closed
cnovel opened this issue Feb 21, 2024 · 5 comments
Closed

Doesn't work on Python 3.12.0 #86

cnovel opened this issue Feb 21, 2024 · 5 comments
Labels

Comments

@cnovel
Copy link

cnovel commented Feb 21, 2024

I tried to install the package with Python 3.12.0, it fails:

(.venv2) PS D:\Documents\Dev\FlickrBack> python --version                   
Python 3.12.0                            
(.venv2) PS D:\Documents\Dev\FlickrBack> pip install flickr_download        
Collecting flickr_download
  Downloading flickr_download-0.3.6-py3-none-any.whl.metadata (5.7 kB)
Collecting PyYAML<6.0,>=5.3 (from flickr_download)
  Downloading PyYAML-5.4.1.tar.gz (175 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 175.1/175.1 kB 812.3 kB/s eta 0:00:00
  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                                                                                                                                                     
  ╰─> [54 lines of output]                                                                                                                                           
      running egg_info
      writing lib3\PyYAML.egg-info\PKG-INFO
      writing dependency_links to lib3\PyYAML.egg-info\dependency_links.txt
      writing top-level names to lib3\PyYAML.egg-info\top_level.txt
      Traceback (most recent call last):
        File "D:\Documents\Dev\FlickrBack\.venv2\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "D:\Documents\Dev\FlickrBack\.venv2\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "D:\Documents\Dev\FlickrBack\.venv2\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Shuna\AppData\Local\Temp\pip-build-env-zkxijm8v\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Shuna\AppData\Local\Temp\pip-build-env-zkxijm8v\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "C:\Users\Shuna\AppData\Local\Temp\pip-build-env-zkxijm8v\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 271, in <module>
        File "C:\Users\Shuna\AppData\Local\Temp\pip-build-env-zkxijm8v\overlay\Lib\site-packages\setuptools\__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Shuna\AppData\Local\Temp\pip-build-env-zkxijm8v\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "C:\Users\Shuna\AppData\Local\Temp\pip-build-env-zkxijm8v\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
          dist.run_commands()
        File "C:\Users\Shuna\AppData\Local\Temp\pip-build-env-zkxijm8v\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "C:\Users\Shuna\AppData\Local\Temp\pip-build-env-zkxijm8v\overlay\Lib\site-packages\setuptools\dist.py", line 963, in run_command
          super().run_command(command)
        File "C:\Users\Shuna\AppData\Local\Temp\pip-build-env-zkxijm8v\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\Shuna\AppData\Local\Temp\pip-build-env-zkxijm8v\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 321, in run
          self.find_sources()
        File "C:\Users\Shuna\AppData\Local\Temp\pip-build-env-zkxijm8v\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 329, in find_sources
          mm.run()
        File "C:\Users\Shuna\AppData\Local\Temp\pip-build-env-zkxijm8v\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 550, in run
          self.add_defaults()
        File "C:\Users\Shuna\AppData\Local\Temp\pip-build-env-zkxijm8v\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 588, in add_defaults
          sdist.add_defaults(self)
        File "C:\Users\Shuna\AppData\Local\Temp\pip-build-env-zkxijm8v\overlay\Lib\site-packages\setuptools\command\sdist.py", line 102, in add_defaults
          super().add_defaults()
        File "C:\Users\Shuna\AppData\Local\Temp\pip-build-env-zkxijm8v\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 251, in add_defaults
          self._add_defaults_ext()
        File "C:\Users\Shuna\AppData\Local\Temp\pip-build-env-zkxijm8v\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 336, in _add_defaults_ext
          self.filelist.extend(build_ext.get_source_files())
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<string>", line 201, in get_source_files
        File "C:\Users\Shuna\AppData\Local\Temp\pip-build-env-zkxijm8v\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 107, in __getattr__
          raise AttributeError(attr)
      AttributeError: cython_sources
      [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.
@beaufour
Copy link
Owner

beaufour commented Mar 2, 2024

Hi, sorry for the delay in getting back to you here. It looks like you are on Windows which I know next to nothing about, and that it fails to install PyYAML. I just updated all the dependencies for the tool to the latest ones, which might, or might not, fix this. So you can give it a new try and install straight from the git repo and see if that fixes it?

 pip install git+https://github.com/beaufour/flickr-download

@cnovel
Copy link
Author

cnovel commented Mar 4, 2024

No worries for the delay, I switched back to Python 3.9 in the meantime.
I've just tested the install straight from the repo, it works fine. However, when trying flickr_download -h, I had the following issue:

Could not load all modules
<class 'ModuleNotFoundError'> No module named 'distutils'
Traceback (most recent call last):
  File "D:\Documents\Dev\FlickrBack\.venv312\Lib\site-packages\oauth2\_version.py", line 13, in <module>
    from pyutil.version_class import Version as pyutil_Version
ModuleNotFoundError: No module named 'pyutil'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\Documents\Dev\FlickrBack\.venv312\Scripts\flickr_download.exe\__main__.py", line 4, in <module>
  File "D:\Documents\Dev\FlickrBack\.venv312\Lib\site-packages\flickr_download\flick_download.py", line 14, in <module>
    import flickr_api as Flickr
  File "D:\Documents\Dev\FlickrBack\.venv312\Lib\site-packages\flickr_api\__init__.py", line 35, in <module>
    from .auth import set_auth_handler
  File "D:\Documents\Dev\FlickrBack\.venv312\Lib\site-packages\flickr_api\auth.py", line 37, in <module>
    import oauth2
  File "D:\Documents\Dev\FlickrBack\.venv312\Lib\site-packages\oauth2\__init__.py", line 47, in <module>
    from ._version import __version__
  File "D:\Documents\Dev\FlickrBack\.venv312\Lib\site-packages\oauth2\_version.py", line 16, in <module>
    from distutils.version import LooseVersion as distutils_Version
ModuleNotFoundError: No module named 'distutils'

No rush in solving the problem, like I said I was able to run the scripts using Python 3.9. It's just that Python 3.12 is officially released so I guessed I wouldn't be the only one with this issue :) If I have some free time, maybe I'll try to fix the issue myself.

@beaufour beaufour changed the title Failed to install with Python 3.12.0 Doesn't work on Python 3.12.0 Mar 5, 2024
@beaufour
Copy link
Owner

beaufour commented Mar 5, 2024

it's because https://github.com/alexis-mignon/python-flickr-api relies on https://github.com/joestump/python-oauth2 which is ancient, so it relies on distutils which is deprecated in 3.12

alexis-mignon/python-flickr-api#138

@beaufour beaufour added the bug label Mar 5, 2024
@eric-saintetienne
Copy link

eric-saintetienne commented Oct 4, 2024

You can fix this by installing a version of PyYAML that works with newer cython:

pip install PyYAML==5.3

Then install flickr-download using pip as in the README.

@beaufour
Copy link
Owner

beaufour commented Oct 5, 2024

I'm assuming this is fixed by the upgrade to a newer PyYAML

@beaufour beaufour closed this as completed Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants