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

PIP 'module' object has no attribute 'main' (pip 10.0) #74

Closed
jjmontesl opened this issue Apr 16, 2018 · 11 comments
Closed

PIP 'module' object has no attribute 'main' (pip 10.0) #74

jjmontesl opened this issue Apr 16, 2018 · 11 comments

Comments

@jjmontesl
Copy link

I'm trying to use pip2tgz but it says that the pip module has no attribute main.

I tried running python, import pip and it doesn't have a main module indeed. I believe this is due to the following change in pip:

  • Move all of pip's APIs into the pip._internal package, properly reflecting the fact that pip does not currently have any public APIs. (#4696, #4700)
  • Removed the deprecated --download option to pip install. (#2643)

Traceback of the error:

$ pip2tgz ./build/pip/ -r requirements.tx
Traceback (most recent call last):
  File "/home/jjmontes/git/scs-control-3.1/env/bin/pip2tgz", line 11, in <module>
    sys.exit(pip2tgz())
  File "/home/jjmontes/git/scs-control-3.1/env/local/lib/python2.7/site-packages/libpip2pi/commands.py", line 58, in maintain_cwd_helper
    return f(*args, **kwargs)
  File "/home/jjmontes/git/scs-control-3.1/env/local/lib/python2.7/site-packages/libpip2pi/commands.py", line 413, in pip2tgz
    pip_run_command(['install', '-d', outdir] + argv[2:])
  File "/home/jjmontes/git/scs-control-3.1/env/local/lib/python2.7/site-packages/libpip2pi/commands.py", line 158, in pip_run_command
    res = pip.main(pip_args)
AttributeError: 'module' object has no attribute 'main'
@quincey001
Copy link

how to resolve this question,upgrade the v10.0.1 ?

@safiyat
Copy link
Collaborator

safiyat commented Apr 24, 2018

Upgrade to v10.0.1 will not help. The changes (#4696, #4700) have moved main inside an internal module, which is there in v10.0.1 too.

@kierun
Copy link

kierun commented Jun 5, 2018

Tried with pip 10.0.1 and the same error happens.

@gotostack
Copy link

Use virtualenv and downgrade the pip verion back to 9.0.0 or 8.0.0. Then this pip2pi works.
Some usages:
$ virtualenv test
$ source test/bin/activate
$ pip install pip2pi
$ pip install pip==8.0.0

@kierun
Copy link

kierun commented Aug 9, 2018

@gotostack This is not an acceptable solution to the problem.

@gotostack
Copy link

@kierun Thanks for reply, : ). Since this issue is open almost four month, I just give people a quick workaround to use such project in few seconds.

@kierun
Copy link

kierun commented Aug 10, 2018

@gotostack Indeed. Pip is now up to version 18.0 (they changed the schema of version numbers because reasons) and this still does not work. Either the project is dead or seriously needs updating. Using old decrepit software is not really a solution. ☺

@walidshaari
Copy link

Thanks, @gotostack I tried your way, however installing molecule dependencies failed for the cryptography-2.3.1
I had to use pip 9.0.0 instead of 8.00

@stonecharioteer
Copy link

Is someone working on this?

@safiyat
Copy link
Collaborator

safiyat commented Aug 29, 2018

@vinay87 I have fixed it in my PR (#75). It has unfortunately not been merged yet.

@kierun
Copy link

kierun commented Aug 29, 2018

@wolever's last committed was on 19 Mar 2017… So, a little premature to call this project dead but certainly getting there.

Personal stuff does happen and this in by no means meant to either insult or hassle @wolever. Clearly, if there is something we can do to help, please let us know. I, for one, am really keen on this project as it is a neat solution to a problem we have.

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

No branches or pull requests

7 participants