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

[Builder] - BugFix - CheckDependencies.py pip._veendor.requests traceback #362

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kdschlosser
Copy link
Member

There appears to be a glitch in version 18.1 of pip. I am not sure how
far back in the versions this problem goes. I do know that if you use
version 9.0.3 of pip when building EG everything is fine.

The problem produces a traceback when importing CheckDependencies

    from pip._vendor import requests
  File "C:\Stackless27\lib\site-packages\pip\_vendor\requests\__init__.py", line 94, in <module>
    from pip._internal.utils.compat import WINDOWS
  File "C:\Stackless27\lib\site-packages\pip\_internal\__init__.py", line 40, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "C:\Stackless27\lib\site-packages\pip\_internal\cli\autocompletion.py", line 8, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "C:\Stackless27\lib\site-packages\pip\_internal\cli\main_parser.py", line 12, in <module>
    from pip._internal.commands import (
  File "C:\Stackless27\lib\site-packages\pip\_internal\commands\__init__.py", line 6, in <module>
    from pip._internal.commands.completion import CompletionCommand
  File "C:\Stackless27\lib\site-packages\pip\_internal\commands\completion.py", line 6, in <module>
    from pip._internal.cli.base_command import Command
  File "C:\Stackless27\lib\site-packages\pip\_internal\cli\base_command.py", line 18, in <module>
    from pip._internal.download import PipSession
  File "C:\Stackless27\lib\site-packages\pip\_internal\download.py", line 15, in <module>
    from pip._vendor import requests, six, urllib3
ImportError: cannot import name requests

They seem to have a broken dynamic import system. So I removed importing
requests from pip._vendor and replaced it with urllib2.urlopen

There appears to be a glitch in version 18.1 of pip. I am not sure how
far back in the versions this problem goes. I do know that if you use
version 9.0.3 of pip when building EG everything is fine.

The problem produces a traceback when importing CheckDependencies

```python
    from pip._vendor import requests
  File "C:\Stackless27\lib\site-packages\pip\_vendor\requests\__init__.py", line 94, in <module>
    from pip._internal.utils.compat import WINDOWS
  File "C:\Stackless27\lib\site-packages\pip\_internal\__init__.py", line 40, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "C:\Stackless27\lib\site-packages\pip\_internal\cli\autocompletion.py", line 8, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "C:\Stackless27\lib\site-packages\pip\_internal\cli\main_parser.py", line 12, in <module>
    from pip._internal.commands import (
  File "C:\Stackless27\lib\site-packages\pip\_internal\commands\__init__.py", line 6, in <module>
    from pip._internal.commands.completion import CompletionCommand
  File "C:\Stackless27\lib\site-packages\pip\_internal\commands\completion.py", line 6, in <module>
    from pip._internal.cli.base_command import Command
  File "C:\Stackless27\lib\site-packages\pip\_internal\cli\base_command.py", line 18, in <module>
    from pip._internal.download import PipSession
  File "C:\Stackless27\lib\site-packages\pip\_internal\download.py", line 15, in <module>
    from pip._vendor import requests, six, urllib3
ImportError: cannot import name requests
```

They seem to have a broken dynamic import system. So I removed importing
requests from pip._vendor and replaced it with urllib2.urlopen
@kdschlosser kdschlosser added this to the v0.5 milestone Jan 18, 2019
@kdschlosser kdschlosser changed the title [Builder] - BugFix - CheckDependenciees.py pip._veendor.requests traceback [Builder] - BugFix - CheckDependencies.py pip._veendor.requests traceback Jan 18, 2019
@AppVeyorBot
Copy link

908-master completed (commit e653b28efb)
Artifacts:
Build.log

@codeclimate
Copy link

codeclimate bot commented Jan 18, 2019

Code Climate has analyzed commit 41ebaf2 and detected 0 issues on this pull request.

View more on Code Climate.

Copy link
Contributor

@topic2k topic2k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why, but appveyor didn't recognized the changes in .appveyor.yml and thus used the cached environment. That means pip 9.01 were used for the build (take a look at the console output of appveyor).

In pip 18.1 the used function get_installed_distributions() has been moved to another sub-modul. You now need to import pip._internal and change the call in line 162 to pip._internal.utils.misc.get_installed_distributions

_build/builder/CheckDependencies.py Show resolved Hide resolved
@kdschlosser
Copy link
Member Author

no it did invalidate the cache

Invalidated as some dependencies (.appveyor.yml) have changed

and that is also why it errored if you scroll down to the bottom. Now the question is why did it say it was successful. when it was not.

I do have to fix the get_installed_distributions. it is moved in newer versions of PIP.

@topic2k topic2k modified the milestones: v0.5, v0.5.1 Mar 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants