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 weather2 fails on Windows 11 with python 3.12 #6

Closed
WiebeBaron opened this issue Nov 16, 2023 · 6 comments
Closed

pip install weather2 fails on Windows 11 with python 3.12 #6

WiebeBaron opened this issue Nov 16, 2023 · 6 comments

Comments

@WiebeBaron
Copy link

Get the following error:

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

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
╰─> [24 lines of output]
      Traceback (most recent call last):
        File "...\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "...\Python\Python312\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 "...\Python\Python312\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 "...\Temp\pip-build-env-dcfzbjz7\overlay\Lib\site-packages\setuptools\build_meta.py", line 355, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "...\Temp\pip-build-env-dcfzbjz7\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in _get_build_requires
          self.run_setup()
        File "...\Temp\pip-build-env-dcfzbjz7\overlay\Lib\site-packages\setuptools\build_meta.py", line 507, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "...l\Temp\pip-build-env-dcfzbjz7\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup
          exec(code, locals())
        File "<string>", line 37, in <module>
        File "<string>", line 11, in read_description
        File "...\Python\Python312\Lib\encodings\cp1252.py", line 23, in decode
          return codecs.charmap_decode(input,self.errors,decoding_table)[0]
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 876: character maps to <undefined>
      [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.
@jenca-adam
Copy link
Owner

Related: kcsaff/getkey#2

Apparently the getkey module weather uses is no longer maintained. However, there is a fork (https://github.com/TheIceBergBot/getkey) that has the PyPI package get-key. I will set it as a requirement in setup.py.

Let me know if this fixes your problem, as I don't have access to Windows

@WiebeBaron
Copy link
Author

Thanks for getting back so quickly, that has indeed resolved the install problem.

It looks like there may still be a windows related issue, I get the following error (also using CLI):

import weather
forecast = weather.forecast(debug=True)

INFO:Debugger has started
INFO:running service "yrno"
INFO:requested url

Exception has occurred: FileNotFoundError
[WinError 3] The system cannot find the path specified: '.cache/weather/fc/xml/New Zealand / Aotearoa'
File "C:\dev\python\MyTest.py", line 6, in
forecast = weather.forecast(debug=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 3] The system cannot find the path specified: '.cache/weather/fc/xml/New Zealand / Aotearoa'


One more small thing is that 'source' from the readme is now 'service' in the weather.forecast definition.

Thanks!

@jenca-adam
Copy link
Owner

Can you provide the full code so that i can reproduce your issue?

@WiebeBaron
Copy link
Author

That is the full source, just the import and the forecast.

Below is the output if calling weather from the command line:

weather --debug
←[36m\Python\Python312\Lib\site-packages\weather_init_.py:1726:forecast ←[39m-> ←[94mINFO←[0m:←[94mDebugger has started←[0m
←[36m\Python\Python312\Lib\site-packages\weather_init_.py:1634:forecast ←[39m-> ←[94mINFO←[0m:←[94mrunning service "yrno"←[0m
←[36m\Python\Python312\Lib\site-packages\weather_init_.py:134:request ←[39m-> ←[94mINFO←[0m:←[94mrequested url←[0m
Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "\Python\Python312\Scripts\weather.exe_main
.py", line 7, in
File "\Python\Python312\Lib\site-packages\weather_init
.py", line 1801, in main
foc=forecast(args.city[0],args.country[0],service=args.service,debug=args.debug)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\Python\Python312\Lib\site-packages\weather_init_.py", line 1728, in forecast
return service.forecast(cityname,countryname,unit)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\Python\Python312\Lib\site-packages\weather_init_.py", line 1636, in forecast
ress.append( SERVICES[service].forecast(*a,**k))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\Python\Python312\Lib\site-packages\weather_init_.py", line 1099, in forecast
return self.ForecastParser.parse(BetaChrome().request(apiurl)[1],unit,cityname,countryname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\Python\Python312\Lib\site-packages\weather_init_.py", line 1030, in parse
cacher.cache(foc)
File "\Python\Python312\Lib\site-packages\weather_init_.py", line 474, in cache
os.makedirs(pt,exist_ok=True)
File "", line 215, in makedirs
File "", line 225, in makedirs
FileNotFoundError: [WinError 3] The system cannot find the path specified: '.cache/weather/fc/xml/New Zealand / Aotearoa'

@jenca-adam
Copy link
Owner

This seems to be an issue with Nominatim returning the country name for New Zealand in multiple languages. I tried to fix this and it seems to work, but if you had any further problems, feel free to create a new issue.

@WiebeBaron
Copy link
Author

WiebeBaron commented Nov 18, 2023

I tried changing the location by using

forecast=weather.forecast('New York')

and still got this error:

FileNotFoundError: [WinError 3] The system cannot find the path specified: '.cache/weather/fc/xml/New Zealand / Aotearoa'

So I tried just creating that directory (Aotearoa was missing) and it now works! NZ is often called (New Zealand / Aotearoa), that might be causing directory issues?

Thanks for looking at this!

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

2 participants