mitchins / micropython-wifimanager

A simple network configuration utility for MicroPython on the ESP-8266 board
BSD 2-Clause "Simplified" License
59 stars 13 forks source link

upip install fails #4

Open deimi opened 4 years ago

deimi commented 4 years ago

I'm unable to install micropython-wifimanger via upip on my ESP8266.

>>> upip.install('micropython-wifimanager')
Installing to: /lib/
Queue: ['micropython-wifimanager']
https://micropython.org/pi/micropython-wifimanager/json
https://pypi.org/pypi/micropython-wifimanager/json
Error installing 'micropython-wifimanager': , packages may be partially installed

Same is on native linux

$ micropython -m upip install --debug micropython-wifimanager
Installing to: /home/asdf/snap/micropython/80/.micropython/lib/
Queue: ['micropython-wifimanager']
https://micropython.org/pi/micropython-wifimanager/json
Warning: micropython.org SSL certificate is not validated
https://pypi.org/pypi/micropython-wifimanager/json
Error installing 'micropython-wifimanager': , packages may be partially installed

It seems that something is wrong with the hosting of the package itself, because if I try to access the link from the logs (https://micropython.org/pi/micropython-wifimanager/json) in my browser, I get "404 Not found" error.

mitchins commented 4 years ago

Thanks, Is that a typo? The json is actually on https://pypi.org/pypi/micropython-wifimanager/json as per your log that's the source it's accessed from too. Weird Looks like their are two https links, one from micro python and one from pypi

deimi commented 4 years ago

No, I wanted to show that the micropython link is not working. I'm not familar with upip and python packaging, but when I install micropython-uasyncio, it works and seems to use only a micropython link, no sign of a pypi link. And there I can access the micropython link in the browser.

$ micropython -m upip install --debug micropython-uasyncio
Installing to: /home/deimi/snap/micropython/80/.micropython/lib/
Queue: ['micropython-uasyncio']
https://micropython.org/pi/micropython-uasyncio/json
Warning: micropython.org SSL certificate is not validated
Installing micropython-uasyncio 2.0 from https://micropython.org/pi/uasyncio/uasyncio-2.0.tar.gz
https://micropython.org/pi/uasyncio/uasyncio-2.0.tar.gz
Skipping micropython_uasyncio.egg-info/PKG-INFO
Skipping micropython_uasyncio.egg-info/requires.txt
Extracting /home/deimi/snap/micropython/80/.micropython/lib/uasyncio/__init__.py
{'deps': b'micropython-uasyncio.core\n'}
Queue: ['micropython-uasyncio.core']
https://micropython.org/pi/micropython-uasyncio.core/json
Installing micropython-uasyncio.core 2.0 from https://micropython.org/pi/uasyncio.core/uasyncio.core-2.0.tar.gz
https://micropython.org/pi/uasyncio.core/uasyncio.core-2.0.tar.gz
Skipping micropython_uasyncio.core.egg-info/PKG-INFO
Extracting /home/deimi/snap/micropython/80/.micropython/lib/uasyncio/core.py
{}

Have you tried? Is it work for you?

deimi commented 4 years ago

@mitchins I have found the problem, after some debugging of upip. In the json file from pypi, there are two elemtents for the 0.3.6 release. The first one is for a "whl" file and the sesond one is for the actual tar file.

        "0.3.6": [
            {
                "comment_text": "",
                "digests": {
                    "md5": "31f3bf6a71eaba2e7a03f85e6e6321d3",
                    "sha256": "ab87110e58a3fc141b8b2cb73c7cedb9d4af6d21809e713e7ae35b9bdba744fd"
                },
                "downloads": -1,
                "filename": "micropython_wifimanager-0.3.6-py3-none-any.whl",
                "has_sig": false,
                "md5_digest": "31f3bf6a71eaba2e7a03f85e6e6321d3",
                "packagetype": "bdist_wheel",
                "python_version": "py3",
                "requires_python": null,
                "size": 5163,
                "upload_time": "2019-02-06T03:23:40",
                "upload_time_iso_8601": "2019-02-06T03:23:40.368994Z",
                "url": "https://files.pythonhosted.org/packages/c7/09/a1d00d0b2ab19417d2fe90e8550f73463243cebb78da29c134970eb041c9/micropython_wifimanager-0.3.6-py3-none-any.whl",
                "yanked": false
            },
            {
                "comment_text": "",
                "digests": {
                    "md5": "1111a4312cdd8fae412c94c4817906e4",
                    "sha256": "aedb07308cd2c836b63243cd7c4e663adb6fa8dfb0a5cc5dbaa2fe15de4e9801"
                },
                "downloads": -1,
                "filename": "micropython-wifimanager-0.3.6.tar.gz",
                "has_sig": false,
                "md5_digest": "1111a4312cdd8fae412c94c4817906e4",
                "packagetype": "sdist",
                "python_version": "source",
                "requires_python": null,
                "size": 4163,
                "upload_time": "2019-02-06T03:23:41",
                "upload_time_iso_8601": "2019-02-06T03:23:41.862222Z",
                "url": "https://files.pythonhosted.org/packages/c2/6a/60dc1437be8f825616970041a0c2032b08995e328e4a58dd69b6687579a0/micropython-wifimanager-0.3.6.tar.gz",
                "yanked": false
            }
        ]

But upip doesn't support two elemts for the release list entry. See line 197 from upip.py. It does an assert for one entry. This is the reason why upip fails without proper error message.

For testing purpose I changed the upip code to pop the first element (whl file) of the release list entry. Then all is working fine the the package get installed. So as far as I understand it, the package (or at least the json file) you have uploaded is wrong.

deimi commented 4 years ago

@mitchins any updates on this?

deimi commented 4 years ago

bump