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

MBED python requirements issues ? #782

Closed
jeromecoutant opened this issue Nov 6, 2018 · 9 comments
Closed

MBED python requirements issues ? #782

jeromecoutant opened this issue Nov 6, 2018 · 9 comments

Comments

@jeromecoutant
Copy link
Contributor

Hi

Since ARMmbed/mbed-os#8542,
python modules version check is more strict.
But I think this doesn't really work ?

  1. missing module check

In my environment, urllib3 is installed.
But if I print pkg here:

missing.append(pkg)

=> I always got urllib3[secure]

  1. module version check

"pip install -r requirements.txt" command is executed only if "missing" is not empty:

if missing and install_requirements:

=> this means that if each package is present, module version is not checked
and ARMmbed/mbed-os#8542 is not useful?

@ciarmcom
Copy link
Member

ciarmcom commented Nov 6, 2018

Internal Jira reference: https://jira.arm.com/browse/MBOCUSTRIA-139

@screamerbg
Copy link
Contributor

Fix is available on mbed-cli master. Could you please try it out and let me know if that fixes the problem?

@screamerbg
Copy link
Contributor

This should be addressed in the new release (1.8.3). Please close the issue if it's fixed.

@jeromecoutant
Copy link
Contributor Author

Hi

1.8.3 release is not ok

TEST

$ pip install colorama==0.3.9
$ mbed test xxx

OK

$ pip install colorama -U
Successfully installed colorama-0.4.0
$ mbed test xxx

==> It crashes….

Traceback (most recent call last):
  File "C:\Python27\Scripts\mbedgt-script.py", line 6, in <module>
    from pkg_resources import load_entry_point
  File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 3123, in <module>
    @_call_aside
  File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 3107, in _call_aside
    f(*args, **kwargs)
  File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 3136, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 580, in _build_master
    return cls._build_from_requirements(__requires__)
  File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 593, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 781, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'colorama<0.4,>=0.3' distribution was not found and is required by mbed-greentea

@jeromecoutant
Copy link
Contributor Author

Hi
Any update ?
As seen above, 1.8.3 release can crash.
Thx

@bridadan
Copy link
Contributor

Hi @jeromecoutant, sorry for the slow reply. I have a change up to bump the dependency version of colorama to include 0.4.x: ARMmbed/greentea#291

@jeromecoutant
Copy link
Contributor Author

Hi
I don't have any specific issue with colorama...
I think there is some issue with the mbed script when version doesn't match with requirements.

@bridadan
Copy link
Contributor

I don't have any specific issue with colorama...

I'm sure you don't 😄 but that was the version error you posted above.

I think there is some issue with the mbed script when version doesn't match with requirements.

This isn't an issue with Mbed CLI in particular, this is just how pip handles dependencies. If another package (or a user) comes in and upgrades/downgrades an installed dependency, then the previously installed packages may break due to the mismatch in required version numbers.

The usual way to avoid this is to use Python Virtual Environments. That way the package has full control over dependency versions.

@TacoGrandeTX
Copy link

@jeromecoutant Have you tried CLI v1.9.1 to see if #833 improves things for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants