pip-autoremove icon indicating copy to clipboard operation
pip-autoremove copied to clipboard

(SOLVED) ModuleNotFoundError: No module named 'pip_autoremove' #32 #43 #44

Open bolijesus opened this issue 2 years ago • 2 comments

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

---------------------------------------------------------------ENGLISH------------------------------------------------------------------------

FOR WINDOWS 10. To fix the error of pip-autoremove, what you have to do is move the files that are installed by default in the folder **C:/Users//AppData/Roaming/Python/Python310, within that folder there are two more folders, /Scripts and */site-package.

/Scripts : contains the . py and/or . exe files of the module or script that are installed by pip in windows. /site-package. : contains the information of that package that was installed by pip, is the path that uses pip list and pip freeze to know which packages are installed and which version each package has.

In order to use the package or script pip-autoremove so as not to fail, you must *move the files to the following paths or folders:

_C:/Users//AppData/Roaming/Python/Python310/Scripts/_pip_autoremove.py must be moved to 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__

and the file C:/Users//AppData/Roaming/Python/Python310/Scripts/ pip-autoremove.exe can be left in that directory, as long as the path C:users//AppData/Roaming/Python/Python310/Path/ is in the environment variables in windows, I leave this video in case you do not know how to configure windows environment variables https://www.youtube.com/watch?v=GvCiCFXEivk, if you do this step, close your cmd or console and reopen it.

If you do not want to configure the environment variable, simply move the file _C:/Users//AppData/Roaming/Python/Python310/Scripts/_pip-autoremove.exe to move it to *C:/Program Files/Python310/ Scripts

after you’ve done all this, you can run pip-autoremove on the console and you should exit

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

bolijesus avatar Oct 07 '22 04:10 bolijesus

that might work when you have a regular python installation. but this does not apply to those who use e.g. pycharm. the paths are very very different.

for those who use pycharm, it is: c:\users\youruser\AppData\Local\Programs\Python\Python3.11\Scripts\pip_autoremove.py which must be moved to c:\users\youruser\AppData\Local\Programs\Python\Python3.11\Lib\pip_autoremove.py

youruser must be of course replaced with your current user and the python version might be also adjusted, depending on the one thats in use

damnms avatar Nov 27 '23 10:11 damnms

In case you have used pipx to install pip-autoremove, the indicated paths must be modified starting from the base path %USERPROFILE%\.local\pipx, and update the pipx_metadata.json file in that path to reflect the change of location of pip_autoremove.py.

Edit: however, when installed using pipx, it seems that pip installed packages are not found.

gulliver-madrid avatar Apr 16 '24 08:04 gulliver-madrid