BradenM / micropy-cli

Micropython Project Management Tool with VSCode support, Linting, Intellisense, Dependency Management, and more!
https://micropy-cli.readthedocs.io
MIT License
314 stars 25 forks source link

Error en install package Ultrasonic #68

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hi

When I try to install package Ultrasonic, I tog follow errors.

micropy install Ultrasonic

MicroPy Loading Project MicroPy esp32-micropython-1.11.0 is already installed!

MicroPy ✔ Project Ready!

MicroPy Installing Packages MicroPy Adding Ultrasonic to requirements... Traceback (most recent call last): File "c:\users\flemm\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "c:\users\flemm\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\Flemm\AppData\Local\Programs\Python\Python37\Scripts\micropy.exe__main.py", line 9, in File "c:\users\flemm\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 764, in call__ return self.main(args, kwargs) File "c:\users\flemm\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 717, in main rv = self.invoke(ctx) File "c:\users\flemm\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "c:\users\flemm\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 956, in invoke return ctx.invoke(self.callback, ctx.params) File "c:\users\flemm\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 555, in invoke return callback(args, kwargs) File "c:\users\flemm\appdata\local\programs\python\python37\lib\site-packages\click\decorators.py", line 64, in new_func return ctx.invoke(f, obj, *args, *kwargs) File "c:\users\flemm\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 555, in invoke return callback(args, kwargs) File "c:\users\flemm\appdata\local\programs\python\python37\lib\site-packages\micropy\cli.py", line 148, in install project.add_package(pkg, dev=dev) File "c:\users\flemm\appdata\local\programs\python\python37\lib\site-packages\micropy\project\project.py", line 241, in add_package self.load_packages() File "c:\users\flemm\appdata\local\programs\python\python37\lib\site-packages\micropy\project\project.py", line 164, in load_packages meta = utils.get_package_meta(name, spec=spec) File "c:\users\flemm\appdata\local\programs\python\python37\lib\site-packages\micropy\utils\helpers.py", line 268, in get_package_meta data = resp.json() File "c:\users\flemm\appdata\local\programs\python\python37\lib\site-packages\requests\models.py", line 897, in json return complexjson.loads(self.text, **kwargs) File "c:\users\flemm\appdata\local\programs\python\python37\lib\json__init__.py", line 348, in loads return _default_decoder.decode(s) File "c:\users\flemm\appdata\local\programs\python\python37\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "c:\users\flemm\appdata\local\programs\python\python37\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 7 column 1 (char 6)

BradenM commented 4 years ago

Hi @fpe,

Can you link me to the package your trying to install? As of this moment, any packages are sourced from pypi and it looks like there isn't a package available named "Ultrasonic" (note: packages are case-sensitive)

However, this does point out the issue that such an error should be properly dealt with rather then exiting with an exception. Will fix soon.

ghost commented 4 years ago

Hi Braden

First thanks.

I use following Library from https://github.com/skgsergio/MicropythonLibs.

Med venlig hilsen Flemming Petersen Kildebakkegårds Allé 24 2870 Dyssegård Mobil : +45 2080 3958 Email : Flemming_Petersen@hotmail.commailto:Flemming_Petersen@hotmail.com


Fra: Braden Mars notifications@github.com Sendt: 10. november 2019 17:31 Til: BradenM/micropy-cli micropy-cli@noreply.github.com Cc: Flemming Petersen flemming_petersen@hotmail.com; Mention mention@noreply.github.com Emne: Re: [BradenM/micropy-cli] Error en install package Ultrasonic (#68)

Hi @fpehttps://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffpe&data=02%7C01%7C%7C3f1da6f4035b4f9021ec08d765fb6fed%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637090002896214094&sdata=ZoW7eS%2FdAMMOAAe5uXY5SA91oA%2BGS%2FKBbdPBnUgZx%2Fc%3D&reserved=0,

Can you link me to the package your trying to install? As of this moment, any packages are sourced from pypihttps://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpypi.org&data=02%7C01%7C%7C3f1da6f4035b4f9021ec08d765fb6fed%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637090002896224105&sdata=wnox22dSxWbvO%2B5nqcExYXPrkDE15V7rkfrYhuFkDSU%3D&reserved=0 and it looks like there isn't a package available named "Ultrasonic" (note: packages are case-sensitive)

However, this does point out the issue that such an error should be properly dealt with rather then exiting with an exception. Will fix soon.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FBradenM%2Fmicropy-cli%2Fissues%2F68%3Femail_source%3Dnotifications%26email_token%3DABRFKS2QNYXDCAK73PG2BKDQTAZN5A5CNFSM4JLMPKL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDVBA4Y%23issuecomment-552210547&data=02%7C01%7C%7C3f1da6f4035b4f9021ec08d765fb6fed%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637090002896234109&sdata=DtCzbhCAUqaQ3p901m0jEth1TEqtSQVs7rmri4cQBb0%3D&reserved=0, or unsubscribehttps://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABRFKSYNNCH5PQH3UZLCU6TQTAZN5ANCNFSM4JLMPKLQ&data=02%7C01%7C%7C3f1da6f4035b4f9021ec08d765fb6fed%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637090002896244114&sdata=voSVmKYBnma554CnwMwnrF4PXO8KarJYIT5hpWXsojQ%3D&reserved=0.

BradenM commented 4 years ago

Oh I see. I will add support for adding packages from git soon.

Something like this maybe:

micropy install git+https://github.com/skgsergio/MicropythonLibs/Ultrasonic

BradenM commented 4 years ago

Hi @fpe,

While I do still plan on implementing adding packages from Git, it is not likely that this specific repo will work, as it is not setup as a package/module (no setup.py or proper structure).

Support for this would simply be too broad, and would have to cover a lot of scenarios.

I suggest taking a look at mPython-hcsr04 as an alternative.

ghost commented 4 years ago

Hi Braden

Thank you very much for the help, I will look at your suggestion and see if it can be used. Just a quick question and I don't know if it's pymacr. I downloaded another packer (BME280) no problems there. When I upload my entire program to esp32, it does not come over. Shouldn't that happen? .

Thanks again for the help and a fantastic program.

Med venlig hilsen / Yours sincerely Flemming Petersen


Fra: Braden Mars notifications@github.com Sendt: 12. november 2019 00:16 Til: BradenM/micropy-cli micropy-cli@noreply.github.com Cc: Flemming Petersen flemming_petersen@hotmail.com; Mention mention@noreply.github.com Emne: Re: [BradenM/micropy-cli] Error en install package Ultrasonic (#68)

Hi @fpehttps://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffpe&data=02%7C01%7C%7C2dd306e9cd1d4bdc609b08d766fd2b71%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637091109848787213&sdata=tz7A4mfdBxhpW35ZpCrxRm3VUVhcIEvl7aga8vJKlW8%3D&reserved=0,

While I do still plan on implementing adding packages from Git, it is not likely that this specific repo will work, as it is not setup as a package/module (no setup.py or proper structure).

Support for this would simply be too broad, and would have to cover a lot of scenarios.

I suggest taking a look at mPython-hcsr04https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpypi.org%2Fproject%2FmPython-hcsr04%2F&data=02%7C01%7C%7C2dd306e9cd1d4bdc609b08d766fd2b71%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637091109848787213&sdata=92OAVTAUrMvFgm3I54gkfn2S4%2BGSoI%2BQVbO7CjCiVhQ%3D&reserved=0 as an alternative.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FBradenM%2Fmicropy-cli%2Fissues%2F68%3Femail_source%3Dnotifications%26email_token%3DABRFKS2XN5JICUKB5U2NDELQTHRULA5CNFSM4JLMPKL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDYO6MI%23issuecomment-552660785&data=02%7C01%7C%7C2dd306e9cd1d4bdc609b08d766fd2b71%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637091109848797217&sdata=kCurRokKB8JnBjdtPRezuzeA%2FXJi1VbvP3HNgM95N7c%3D&reserved=0, or unsubscribehttps://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABRFKS4IDJLVBFFT72BN543QTHRULANCNFSM4JLMPKLQ&data=02%7C01%7C%7C2dd306e9cd1d4bdc609b08d766fd2b71%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637091109848807225&sdata=sVBR4IhNwXou9bhqfOt0PziqCw8vm%2F96qNYwP35Y6UE%3D&reserved=0.

BradenM commented 4 years ago

No problem!

Currently there are more than a few ways to upload external libs with micropython (see here) and as such, I originally decided to only handle the local features (autocomplete/intellisense/etc) for deps and leave uploading the libs to a device up to the user.

However, I will soon be adding additional options to micropy install to allow users to either upload files via a /lib folder or freeze modules and rebuild the firmware using micropy-build.

Thank you for the support :heart: