invl/pip-autoremove

pip-autoremove 0.10.0 no longer runs on Windows

marsfan opened this issue ยท 18 comments

The changes to the package build process now installs pip_autoremove.py to C:\Python3.9\Scripts instead of C:\Python3.9\Lib\site-packages.

C:\Python3.9\Scripts is not on PYTHONPATH, so atttempting to run pip-autoremove results in the following error:

Traceback (most recent call last):
  File "C:\\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\\Python39\Scripts\pip-autoremove.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip_autoremove'
`

Same issue here.

just found that python3-pip-autoremove it works but is not updates since year now but it works

If you can, please test #44 and report back if that works for you. I'm not seeing any negative effects on Mac OS or Linux, so just a question of whether this works on Windows or not.

@tresni #44 does indeed fix the problem when running on Windows.

Before my pr get merged, if anyone wants to use my fix, run pip install git+https://github.com/imba-tjd/pip-autoremove@ups. Just remember to reinstall the original package after being merged.

@imba-tjd not worek for me. seems your command is wrong

fatal: repository 'https://github.com/imba-tjd/pip-autoremove/tree/ups/' not found

EDIT: fixed with pip install --force git+https://github.com/imba-tjd/pip-autoremove@ups

Thanks, I didn't know that. I have updated my comment.

Dysta commented

Same issue here

Same here

xahon commented

same

@imba-tjd Your fix didn't worked for me. It installs and everything but still not running.

@matias-fuentes I can't help. I just found that --force will try to reinstall pip even though it's the latest version, so that it fails to install due to permission denied. I have updated my comment to remove the flag.
But you said it installs, meaning that's not the issue you met.

Same issue on Windows

This is a known issue, see #44 .

@tresni Yes it is, and it has been shown to you countless times (#32 #43 #44) that the PR you're linking is clearly needed for a lot of the population. So what are you waiting exactly to merge it ?? It's been almost a year.

I have no power to merge anything. I just try to make sure people know where the fix is. @invl is the only one with access to merge anything.

Traceback (most recent call last):
  File "C:\\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\\Python39\Scripts\pip-autoremove.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip_autoremove'

PARA WINDOWS 10.
Para solucionar el error de pip-autoremove, lo que se tiene que hacer es mover los archivos que se instalan por defecto en la carpeta C:/Users//AppData/Roaming/Python/Python310 , dentro de esa carpeta estan hay dos carpetas mรกs, /Scripts y /site-package.

/Scripts : contiene los archivos .py y/o .exe del modulo o script que se instalan por pip en windows.
/site-package. : contiene la informacion de ese paquete que se instalo por pip, es la ruta que utiliza pip list y pip freeze para saber que paquetes estan instalados y que version tiene cada paquete.

Para poder usar el paquete o script pip-autoremove de manera que no de error, se deben mover los archivos a las siguientes rutas o carpetas:

C:/Users//AppData/Roaming/Python/Python310/Scripts/ pip_autoremove.py se debe mover a C:/Program Files/Python310/ Lib

C:/Users//AppData/Roaming/Python/Python310/Scripts/__pycache__/ pip_autoremove.cpython-310.pyc se debe mover a C:/Program Files/Python310/Lib/__pycache__

y el archivo C:/Users//AppData/Roaming/Python/Python310/Scripts/ pip-autoremove.exe se puede dejar en ese directorio, siempre y cuando la ruta C:/Users//AppData/Roaming/Python/Python310/Scripts/ este en el path de las variables de entorno en windows, dejo este video por si no saben configurar las variables de entorno de windows https://www.youtube.com/watch?v=GvCiCFXEivk, si hacen este paso, cierren su cmd o consola y vuelvan a abrirla.

Si no quieren configurar la variable de entorno, simplemente muevan el archivo C:/Users//AppData/Roaming/Python/Python310/Scripts/ pip-autoremove.exe moverlo a C:/Program Files/Python310/ Scripts

luego de ya haber hecho todo esto, pueden ejecutar pip-autoremove en la consola y les debe salir

Usage: pip-autoremove [OPTION]... [NAME]...

`Options:

--version show program's version number and exit

-h, --help show this help message and exit

-l, --list list unused dependencies, but don't uninstall them.

-L, --leaves list leaves (packages which are not used by any others).

-y, --yes don't ask for confirmation of uninstall deletions.

-f, --freeze list leaves (packages which are not used by any others) in

            requirements.txt format`

Espero sirva mi aporte ๐Ÿ‘

seems like this module is very broken when such basic stuff is not merged. which is really sad, because it seems like that module could solve my problem. @invl