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

No python3 support? #18

Closed
cefn opened this issue May 21, 2018 · 14 comments
Closed

No python3 support? #18

cefn opened this issue May 21, 2018 · 14 comments

Comments

@cefn
Copy link

cefn commented May 21, 2018

I installed pip-autoremove using pip3 but unfortunately it isn't indicated anywhere that it's a Python2 only tool. Perhaps the github could be updated to indicate this, or the python3 version could be removed.

Initially pip-autoremove didn't work at all, since it had an undeclared dependency on Pypi 'testresources'. After I installed pip3 install testresources the utility would then run, but failed when attempting to run a pip autoremove operation...

$ pip-autoremove serial
serial 0.0.66 (/home/cefn/.local/lib/python3.6/site-packages)
    PyYAML 3.12 (/home/cefn/.local/lib/python3.6/site-packages)
    future 0.16.0 (/home/cefn/.local/lib/python3.6/site-packages)
    iso8601 0.1.12 (/home/cefn/.local/lib/python3.6/site-packages)
Uninstall (y/N)?y
Traceback (most recent call last):
  File "/home/cefn/.local/bin/pip-autoremove", line 11, in <module>
    sys.exit(main())
  File "/home/cefn/.local/lib/python3.6/site-packages/pip_autoremove.py", line 106, in main
    autoremove(args, yes=opts.yes)
  File "/home/cefn/.local/lib/python3.6/site-packages/pip_autoremove.py", line 24, in autoremove
    remove_dist(d)
  File "/home/cefn/.local/lib/python3.6/site-packages/pip_autoremove.py", line 83, in remove_dist
    subprocess.check_call(["pip", "uninstall", "-y", dist.project_name])
  File "/usr/lib/python3.6/subprocess.py", line 286, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python3.6/subprocess.py", line 267, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'pip': 'pip'

If it actually does have python3 support, but is assuming that pip3 is aliased to pip, this is not always the case, as in my Ubuntu, Debian-based OS which only has pip3 installed and in any case pip would alias to the python2 version.

@im-n1
Copy link

im-n1 commented Jun 16, 2018

+1

@cefn
Copy link
Author

cefn commented Jun 17, 2018

Isn't there a way to directly call pip from within the VM anyway which eliminates the need to drop into the system shell? On my machine, (virtualenv with pip3) the following would work.

from pip.__main__ import _main as pipMain
pipMain(["uninstall", "-y", dist.project_name])

@ghost
Copy link

ghost commented Jul 10, 2018

Just tried it and it works for me (Python 3.6)

@prof7bit
Copy link

It probably only works when pip is a symlink to pip3 but usually (Debian, Ubuntu) these two are completely separate, pip only works with pytrhon2 and pip3 only with python3

@konomikitten
Copy link

It would be nice if pip-autoremove produced both pip-autoremove2 and pip-autoremove3 respectively.

@dandrei
Copy link

dandrei commented Nov 25, 2018

Thanks to @prof7bit's comment I got it working this way:

sudo ln -s /usr/bin/pip3 /usr/bin/pip

@im-n1
Copy link

im-n1 commented Dec 21, 2018

Well there is a pull request #22 which is 3 months old already and no response.

Semms like this project is abandoned ..... at least for now.

@tresni
Copy link
Contributor

tresni commented Apr 11, 2020

tresni/pip-autoremove has been updated to work with python 3.7 and includes most of the PRs from here.

@im-n1
Copy link

im-n1 commented Apr 12, 2020

Looks cool but Poetry..

@tresni
Copy link
Contributor

tresni commented Apr 12, 2020

I’m confused. Are you asking for Poetry support? My fork has the same requirements as this repo (a working python and tox if you want to run tests.)

If you are saying there are other ways to deal with this issue like Poetry or virtualenv or venga, I agree. I still find this tool useful from time to time.

@amard33p
Copy link

tresni/pip-autoremove has been updated to work with python 3.7 and includes most of the PRs from here.

This works well with Python 3.7. Just FYI, here's how to install:
pip3 install git+https://github.com/tresni/pip-autoremove.git

@tresni
Copy link
Contributor

tresni commented Sep 17, 2021

Should be addressed by the merge of #42 and the new release, please close if that resolves your issue.

@cefn
Copy link
Author

cefn commented Sep 17, 2021

Thanks for your efforts, tresni. I don't have the means of easily testing the original configuration, where pip was aliased to pip2 on debian. These days my pip is aliased to pip3 anyway.

@cefn cefn closed this as completed Sep 17, 2021
@cefn
Copy link
Author

cefn commented Sep 17, 2021

Thanks for your efforts, tresni. I don't have the means of easily testing the original configuration, where pip was aliased to pip2 on debian. These days my pip is aliased to pip3 anyway.

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