collinb9 / understatAPI

An API for scraping data from understat.com
MIT License
10 stars 2 forks source link

Python3.9 Installation Issue #8

Closed hedonistrh closed 2 years ago

hedonistrh commented 2 years ago

Hey @collinb9, I tried to install it with python3.9 and there is an issue. I am not sure py3.9 support is ready or not but just for your information, i am sharing error message. And I am able to install other packages with that pip, just fyi.

→ python3.9 -m pip install understatapi
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Collecting understatapi
  Downloading understatapi-0.6.1.tar.gz (397 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 397.2/397.2 kB 1.7 MB/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
  ╰─> [38 lines of output]
      Traceback (most recent call last):
        File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 102, in __init__
          req = REQUIREMENT.parseString(requirement_string)
        File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/_vendor/pyparsing/core.py", line 1143, in parse_string
          raise exc.with_traceback(None)
      pkg_resources._vendor.pyparsing.exceptions.ParseException: Expected string_end, found ':'  (at char 4), (line:1, col:5)

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/build_meta.py", line 177, in get_requires_for_build_wheel
          return self._get_build_requires(
        File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/build_meta.py", line 159, in _get_build_requires
          self.run_setup()
        File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/build_meta.py", line 174, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 1, in <module>
        File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/__init__.py", line 86, in setup
          _install_setup_requires(attrs)
        File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/__init__.py", line 78, in _install_setup_requires
          dist.parse_config_files(ignore_option_errors=True)
        File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/dist.py", line 871, in parse_config_files
          self._finalize_requires()
        File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/dist.py", line 578, in _finalize_requires
          self._move_install_requirements_markers()
        File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/dist.py", line 618, in _move_install_requirements_markers
          inst_reqs = list(_reqs.parse(spec_inst_reqs))
        File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3102, in __init__
          super(Requirement, self).__init__(requirement_string)
        File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 104, in __init__
          raise InvalidRequirement(
      pkg_resources.extern.packaging.requirements.InvalidRequirement: Parse error at "': requir'": Expected string_end
      [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.
WARNING: There was an error checking the latest version of pip.
collinb9 commented 2 years ago

Thanks for creating the issue. I haven't been able to reproduce the issue with python 3.9.13. I wonder if that deprecation warning at the top of your output is relevant to you? Are you having this issue with other versions of python?

hedonistrh commented 2 years ago

Thanks for your reply. That deprecation warning is related with https://github.com/Homebrew/homebrew-core/issues/76621 and that should not break anything. My python version is Python 3.9.13 as well. Also some other people has that issue as well with different packages https://stackoverflow.com/q/59552380. So something can be broken with my pip as well. I'll continue to investigation and come back to you. 🏃

collinb9 commented 2 years ago

Yeah I looked at the linked issue and there shouldn't be any problem related to that. Sounds good. If you find that there is an issue with this repo feel free to submit a pull request

hedonistrh commented 2 years ago

Just fyi, able to install version 0.5.2 from pip. Possibly v0.6 related build changes broke something in my pip. I'll continue to investigation and update you later on. 💯

Edit: v0.5.2 one is failing with following so I'll definetely try to solve installation issue of latest version

from understatapi import UnderstatClient

understat = UnderstatClient()
hedonistrh commented 2 years ago

I solved the issue with creating new fresh environment with venv. Now, it is working without any issue. So if anyone would encounter with this issue, can think that something is problematic with one of the installed packages (most likely malfunctioned pip installation) and can check this answer. There is no global solution, so i definitely suggest that use fresh venv if you can do.