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

micropy install dependency issue #106

Open
beerygaz opened this issue May 12, 2020 · 1 comment
Open

micropy install dependency issue #106

beerygaz opened this issue May 12, 2020 · 1 comment
Labels
question Further information is requested

Comments

@beerygaz
Copy link

beerygaz commented May 12, 2020

I'm new to micropython, so this may well be the fault of inexperience but here goes:

I'm using your great tool under Windows and VS Code.

I'm trying to run some code that depends on urlli.parse and urllib.parse depends on a module called collections.

I have run 'micropy install micropython-urllib.parse' and 'micropy install micropython-collections'

However, once uploaded to my pycom fipy I keep getting the error

File "/flash/lib/parse.py", line 32, in <module>
ImportError: no module named 'collections'

However:

>>> os.listdir('lib')
['micropython-collections', 'micropython-hashlib', 'base64.py', 'defaultdict.py', 'hmac.py', 'mqtt_async.py', 'parse.py', 'urllib.py', 'warnings.py']

Any idea where I'm going wrong?

@beerygaz beerygaz added the question Further information is requested label May 12, 2020
@askpatrickw
Copy link
Contributor

This is mentioned in the docs, but its not intuitive given how Python development normally works AND I'm going through this exact same learning curve today. ;-)

micropy install only makes the stubs available to vscode.
To install the package you need to use upip on your device (if it has network connectivity) use upip from your dev machine which you can then copy it over to your /src/lib or to use micropip.py.

To run upip locally, I think you need to compile MicroPython. I'm asking about that in the MP Forum: https://forum.micropython.org/viewtopic.php?f=2&t=8354

I hope that helps and if I got anything wrong please let me know.. I'm also just figuring this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants