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

Unable to create compliant pip installation on windows #163

Closed
hohwille opened this issue Aug 2, 2022 · 1 comment
Closed

Unable to create compliant pip installation on windows #163

hohwille opened this issue Aug 2, 2022 · 1 comment
Labels

Comments

@hohwille
Copy link

hohwille commented Aug 2, 2022

get-pip supports --prefix option what is great.
I wanted to use it to install pip into an own pip folder alongside python folder.
This creates a pip installation with the desired structure having a bin folder also on Windows avoiding cross-platform incompatibilities.
However, the resulting pip installation does not work:

$ pip --version
Traceback (most recent call last):
  File "runpy.py", line 196, in _run_module_as_main
  File "runpy.py", line 86, in _run_code
  File "D:\projects\devonfw\software\python\pip.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip'

If you have any hint or solution to this problem you would do us a great favor as we want to integrate python and pip into devonfw-ide to make it available easier and create a seamless automated installation for all platforms. Unfortunately Python and pip are giving us an extraordinary hard time to make this happen.

Related issues:

@pradyunsg
Copy link
Member

Hiya!

I wanted to use it to install pip into an own pip folder alongside python folder.

You can't do that. The way that the Python interpreter works is that certain locations are the default import paths for it -- only those paths are used in locating a <packagename> in import <packagename>.

By using --prefix, you're dumping pip's file in an arbitrary location -- a location that may not be on the import paths for the interpreter.

The solution here is to not try to use --prefix and to instead ship pip as a part of site-packages in Python. That's the default behaviour of doing a pip install as well as get-pip.py and I suggest you stick to that.

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

No branches or pull requests

2 participants