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

nikola plugin install dependency with pip in wrong python version #2275

Closed
davidak opened this issue Feb 29, 2016 · 13 comments
Closed

nikola plugin install dependency with pip in wrong python version #2275

davidak opened this issue Feb 29, 2016 · 13 comments
Assignees
Milestone

Comments

@davidak
Copy link
Contributor

davidak commented Feb 29, 2016

i use Nikola with python3, so it has to use pip3 to install dependencys

example: nikola plugin -i import_page

@ralsina
Copy link
Member

ralsina commented Feb 29, 2016

So, for python 2 it's guaranteed to be available as pip2 and for python 3 as pip3, right?

@davidak
Copy link
Contributor Author

davidak commented Feb 29, 2016

no, it's not that simple

@ralsina
Copy link
Member

ralsina commented Feb 29, 2016

how isn't it that simple? Anyone has a python 2 without a pip2 and a python3 without a pip3?

@ralsina
Copy link
Member

ralsina commented Feb 29, 2016

Alternatively, it's possible to use pip as a module but I don't have details.

@da2x
Copy link
Contributor

da2x commented Feb 29, 2016

Some distros use pip3.4 with no pip3 alias. Using the module would probably be a better solution.

@ralsina
Copy link
Member

ralsina commented Mar 1, 2016

Doesn't look very hard. For example, this works:

import pip
pip.main(['freeze'])

@ralsina ralsina self-assigned this Mar 1, 2016
@ralsina ralsina added this to the v7.7.7 milestone Mar 1, 2016
@ralsina
Copy link
Member

ralsina commented Mar 1, 2016

Blah, pip is really weird. Working through it but it sucks.

Fun: pip has an internal "requests" module, so if we have requests imported that explodes awesomely.
This is not worth it. If it fails to call pip correctly, Nikola tells you "install this using your package manager or pip" and that's going to work...

@ralsina
Copy link
Member

ralsina commented Mar 1, 2016

Yep, totally not doing this. Sorry.

@ralsina ralsina closed this as completed Mar 1, 2016
@davidak
Copy link
Contributor Author

davidak commented Mar 2, 2016

If it fails to call pip

it just calls pip and installs it in the wrong version. can we prevent that?

@ralsina
Copy link
Member

ralsina commented Mar 2, 2016

We can make it stop trying to install things at all.

On Tue, Mar 1, 2016 at 9:08 PM davidak [email protected] wrote:

If it fails to call pip

it just calls pip and installs it in the wrong version. can we prevent
that?


Reply to this email directly or view it on GitHub
#2275 (comment).

@davidak
Copy link
Contributor Author

davidak commented Mar 2, 2016

it could just display the command.

@ralsina
Copy link
Member

ralsina commented Mar 2, 2016

And then this bug would be "it's printing the wrong command, I ran it and
it installed things in the wrong python"

On Wed, Mar 2, 2016 at 3:11 AM davidak [email protected] wrote:

it could just display the command.


Reply to this email directly or view it on GitHub
#2275 (comment).

@Kwpolska
Copy link
Member

Kwpolska commented Mar 2, 2016

We could use sys.executable for this.

@Kwpolska Kwpolska reopened this Mar 2, 2016
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

4 participants