Lich-Corals / linux-file-converter-addon

Convert between various image, audio and video formats.
GNU General Public License v3.0
15 stars 6 forks source link

Cant get python get-pip.py command to work. Following your instructions has been a real headache. #4

Closed Username23453 closed 1 year ago

Username23453 commented 1 year ago

For example theres python & python3 that i must differentiate. I guess this is where I'm stuck: https://pip.pypa.io/en/stable/installation/#ensurepip

I just need a right click menu option to convert any image to PNG. I dont understand why linux has to make it so difficult. There was like 10 different ways to do it easily when I was using windows. :( 😢

Lich-Corals commented 1 year ago

For example theres python & python3 that i must differentiate. I guess this is where I'm stuck: https://pip.pypa.io/en/stable/installation/#ensurepip

I just need a right click menu option to convert any image to PNG. I dont understand why linux has to make it so difficult. There was like 10 different ways to do it easily when I was using windows. :( cry

Thank you for posting this issue.

Please try to exactly specify what the problem is, I can't help you with the information you already gave me.

If I got it right you can't install pip. First of all you should check if Python is installed and up to date. If this isn't the case you can install it from their website, then you can retry using pip or installing it.

If this doesn't solve the problem, it would be helpful if I got some more information. Most important are you distro (especially the package manager you're using), the operation that's not working and the error you get when you're trying to do it.

@Intellectual234

Username23453 commented 1 year ago

@Lich-Corals , Hello, thank you for your help & response, I've made some progress, as the package names & process for python & pip has changed severely & was very confusing, troublesome/headache inducing. So now when I use the " nautilus -q " command I get: "nautilus -q File "/usr/share/nautilus-python/extensions/nautilus-fileconverter.py", line 8 print=lambda *wish, **verbosity: None # comment it out, if you wish debug printing ^ SyntaxError: invalid syntax"

What should I do? -Thanks!

derVedro commented 1 year ago

What should I do? -Thanks!

You can just comment the line with that print out. Put a # in front of the line. It's the simplest solution.

By the way, that python and system do you use?

Username23453 commented 1 year ago

@derVedro , thank you, but I dont know what u mean, what do i type in the terminal? & why should i type it? what will it do? -Thanks!

derVedro commented 1 year ago

Ok, to get rid of this error output, you have to edit /usr/share/nautilus-python/extensions/nautilus-fileconverter.py line number 8, put a # in front of the line as first character. You need superuser/root access to edit that file.

The second part is only for my modest interest. I just want to know what version of Python you're using and what system you're running. You can use python3 --version for Python and lsb_release -a for the system versions.

Username23453 commented 1 year ago

@derVedro , Thank you, now I am getting another error, "nautilus -q File "/usr/share/nautilus-python/extensions/nautilus-fileconverter.py", line 43 def get_file_items(self, files) -> List[Nautilus.MenuItem]: ^ SyntaxError: invalid syntax"

Also "Python 3.8.10" & "No LSB modules are available. Distributor ID: Zorin Description: Zorin OS 16.2 Release: 16 Codename: focal"

Username23453 commented 1 year ago

@derVedro , I wish i could just find a right click menu option, that is easy, quick & in the 1st layer of the menu only, not a 2nd layer to it. And that i can select bulk images & convert them to PNG, automatically, no asking me each time where i want it saved or what i want to name it,etc. I recently moved from Windows 7 to ZorinOS, & Windows 7 had a ton of programs that could do this.

Lich-Corals commented 1 year ago

@derVedro , Thank you, now I am getting another error, "nautilus -q File "/usr/share/nautilus-python/extensions/nautilus-fileconverter.py", line 43 def get_file_items(self, files) -> List[Nautilus.MenuItem]: ^ SyntaxError: invalid syntax"

Also "Python 3.8.10" & "No LSB modules are available. Distributor ID: Zorin Description: Zorin OS 16.2 Release: 16 Codename: focal"

The issue with the LSB modules seems to be relatively common. I didn't have this issue myself, so I can't say if it's a working solution, what I found here. In the case you didn't try this already I would recommend you giving the solution a try.

I would also recommend you to update the nautilus-fileconverter script, because it was updated since you got the error. There are also some other improvements in the script.

derVedro commented 1 year ago

ok, forget about LSB and stuff. You use Zorin OS 16.2 with Python 3.8.10, so it's based on 20.04 (focal) Ubuntu. I guess all your troubles are related to python2. Focal python-nautilus package is for python2. I suggest you remove it and install python3-nautilus.

$ sudo apt purge python-nautilus & sudo apt install python3-nautilus
Username23453 commented 1 year ago

@derVedro , I did your command & here is the result i got, i'm not sure if it worked, the ending result looks weird, did it work?: "sudo apt purge python-nautilus & sudo apt install python3-nautilus [1] 4688 [sudo] password for username123:
Reading package lists... Done Building dependency tree
Reading state information... Done The following packages were automatically installed and are no longer required: adwaita-qt cabextract chromium-codecs-ffmpeg-extra coinor-libcbc3 coinor-libcgl1 coinor-libclp1 coinor-libcoinmp1v5 coinor-libcoinutils3v5 coinor-libosi1v5 filemanager-actions filemanager-actions-data filemanager-actions-libs fonts-wine gstreamer1.0-plugins-good:i386 gstreamer1.0-vaapi gstreamer1.0-x:i386 heif-gdk-pixbuf icoutils jq libaa1:i386 libaom0:i386 libavc1394-0:i386 libavcodec58:i386 libavutil56:i386 libcaca0:i386 libcapi20-3 libcapi20-3:i386 libcodec2-0.9:i386 libdv4:i386 libfaudio0 libfaudio0:i386 libgomp1:i386 libgsm1:i386 libgstreamer-plugins-good1.0-0:i386 libgudev-1.0-0:i386 libiec61883-0:i386 libjq1 libmp3lame0:i386 libmpg123-0:i386 libnuma1:i386 libonig5 libopenal1:i386 libopenjp2-7:i386 libpython2.7 libraw1394-11:i386 libshine3:i386 libshout3:i386 libslang2:i386 libsnappy1v5:i386 libsndio7.0:i386 libsoxr0:i386 libspeex1:i386 libstb0 libstb0:i386 libswresample3:i386 libtag1v5:i386 libtag1v5-vanilla:i386 libtwolame0:i386 libva-wayland2 libvdpau1:i386 libvkd3d1 libvkd3d1:i386 libvpx6:i386 libwavpack1:i386 libwebpmux3:i386 libwine libwine:i386 libwxbase3.0-0v5 libwxgtk3.0-gtk3-0v5 libx264-155:i386 libx265-179:i386 libxmlsec1 libxmlsec1-nss libxslt1.1:i386 libxv1:i386 libxvidcore4:i386 libz-mingw-w64 libzvbi0:i386 mesa-vdpau-drivers:i386 nautilus-extension-fma nemo-extension-fma playonlinux python-gi python-wxgtk3.0 python-wxversion vdpau-driver-all:i386 wine32:i386 wine64 zorin-windows-app-support-desktop-files Use 'sudo apt autoremove' to remove them. The following packages will be REMOVED: python-nautilus The following NEW packages will be installed: python3-nautilus 0 upgraded, 1 newly installed, 1 to remove and 2 not upgraded. Need to get 18.0 kB of archives. After this operation, 13.3 kB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-nautilus amd64 1.2.3-1ubuntu1 [18.0 kB] Fetched 18.0 kB in 0s (112 kB/s)
(Reading database ... 288632 files and directories currently installed.) Removing python-nautilus (1.2.3-1ubuntu1) ... Selecting previously unselected package python3-nautilus. (Reading database ... 288612 files and directories currently installed.) Preparing to unpack .../python3-nautilus_1.2.3-1ubuntu1_amd64.deb ... Unpacking python3-nautilus (1.2.3-1ubuntu1) ... Setting up python3-nautilus (1.2.3-1ubuntu1) ...

[1]+ Stopped sudo apt purge python-nautilus"

Lich-Corals commented 1 year ago

I did your command & here is the result i got, i'm not sure if it worked, the ending result looks weird, did it work?: "sudo apt purge python-nautilus & sudo apt install python3-nautilus [1] 4688 [sudo] password for username123:
Reading package lists... Done Building dependency tree
Reading state information... Done The following packages were automatically installed and are no longer required: adwaita-qt cabextract chromium-codecs-ffmpeg-extra coinor-libcbc3 coinor-libcgl1 coinor-libclp1 coinor-libcoinmp1v5 coinor-libcoinutils3v5 coinor-libosi1v5 filemanager-actions filemanager-actions-data filemanager-actions-libs fonts-wine gstreamer1.0-plugins-good:i386 gstreamer1.0-vaapi gstreamer1.0-x:i386 heif-gdk-pixbuf icoutils jq libaa1:i386 libaom0:i386 libavc1394-0:i386 libavcodec58:i386 libavutil56:i386 libcaca0:i386 libcapi20-3 libcapi20-3:i386 libcodec2-0.9:i386 libdv4:i386 libfaudio0 libfaudio0:i386 libgomp1:i386 libgsm1:i386 libgstreamer-plugins-good1.0-0:i386 libgudev-1.0-0:i386 libiec61883-0:i386 libjq1 libmp3lame0:i386 libmpg123-0:i386 libnuma1:i386 libonig5 libopenal1:i386 libopenjp2-7:i386 libpython2.7 libraw1394-11:i386 libshine3:i386 libshout3:i386 libslang2:i386 libsnappy1v5:i386 libsndio7.0:i386 libsoxr0:i386 libspeex1:i386 libstb0 libstb0:i386 libswresample3:i386 libtag1v5:i386 libtag1v5-vanilla:i386 libtwolame0:i386 libva-wayland2 libvdpau1:i386 libvkd3d1 libvkd3d1:i386 libvpx6:i386 libwavpack1:i386 libwebpmux3:i386 libwine libwine:i386 libwxbase3.0-0v5 libwxgtk3.0-gtk3-0v5 libx264-155:i386 libx265-179:i386 libxmlsec1 libxmlsec1-nss libxslt1.1:i386 libxv1:i386 libxvidcore4:i386 libz-mingw-w64 libzvbi0:i386 mesa-vdpau-drivers:i386 nautilus-extension-fma nemo-extension-fma playonlinux python-gi python-wxgtk3.0 python-wxversion vdpau-driver-all:i386 wine32:i386 wine64 zorin-windows-app-support-desktop-files Use 'sudo apt autoremove' to remove them. The following packages will be REMOVED: python-nautilus The following NEW packages will be installed: python3-nautilus 0 upgraded, 1 newly installed, 1 to remove and 2 not upgraded. Need to get 18.0 kB of archives. After this operation, 13.3 kB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-nautilus amd64 1.2.3-1ubuntu1 [18.0 kB] Fetched 18.0 kB in 0s (112 kB/s)
(Reading database ... 288632 files and directories currently installed.) Removing python-nautilus (1.2.3-1ubuntu1) ... Selecting previously unselected package python3-nautilus. (Reading database ... 288612 files and directories currently installed.) Preparing to unpack .../python3-nautilus_1.2.3-1ubuntu1_amd64.deb ... Unpacking python3-nautilus (1.2.3-1ubuntu1) ... Setting up python3-nautilus (1.2.3-1ubuntu1) ...

[1]+ Stopped sudo apt purge python-nautilus"

You can use

python --version

to check if python is installed, with

lsb_release

you can check if you still get the LSB error.

derVedro commented 1 year ago

did it helped? can you now use the nautilus converter?

Username23453 commented 1 year ago

@derVedro , @Lich-Corals , thank you both for all the help. How can i check if python3-nautilus installed? Please look at my terminal attempt, I made several attempts:

https://rentry.co/569w3

derVedro commented 1 year ago

Looks okay, package is installed. Why you just not run nautilus and try the context menu? You should get something like that: frz

Username23453 commented 1 year ago

@derVedro , its not working, what file path/folder should i be putting the "nautilus-fileconverter.py'" file in? Here is a screenshot of it not working: image

ALSO, here is the file manager i am using, its called "Files" but its also known as "Nautilus": image

derVedro commented 1 year ago

Put it in your ~/.local/share/nautilus-python/extensions/, then quit nautilus by $ nautilus -q and run nautilus again by $ nautilus

Lich-Corals commented 1 year ago

@Intellectual234 ,

The file manager should be right, you can test it by running the 'nautilus' command in a terminal. Nautilus is the 'real' name of the program, but it's called Files, because nobody would know what nautilus is. I also don't know if the extension will run with your instillation of nautilus, because you have '3.36.3', and the extension is built for 43.x.

The script can be placed in two dictionaries, in /usr/share/nautilus-python/extensions/ for a system-wide installation, and in ~/.local/share/nautilus-python/extensions/ for your user only. The '~' in the path is your users home dictionary, to see the '.local' folder you can press 'ctrl + h', because it has a dot in front of the name, which indicates that it's a hidden folder.

derVedro commented 1 year ago

yeah, I am not sure about older nautilus like 3.36.3, at some point they changed signature of get_file_items(self, window, files) to get_file_items(self, files), so I guess it would not adhoc work.

Lich-Corals commented 1 year ago

yeah, I am not sure about older nautilus like 3.36.3, at some point they changed signature of get_file_items(self, window, files) to get_file_items(self, files), so I guess it would not adhoc work.

If not you could run nautilus with the extension installed in the terminal, and see which errors appear. If the problem isn't too big, I could (try to) develop a version of the script for an older nautilus.

Username23453 commented 1 year ago

@Lich-Corals , @derVedro , I am very smart & can follow your commands to try to help diagnose this issue, if you guide me, let me know what you want me to do. I really need a simple image to PNG convert option, & bulk one too. Very quick one. Thanks! :)

Username23453 commented 1 year ago

Also, there is no "nautilus-python" in my ~/.local/share/ directory. But local/share/nautilus-python/extensions/ does show up & I have had "nautilus-fileconverter.py' in there for a long time now.

Username23453 commented 1 year ago

Here is an answer in regards to ZorinOS & 3.63 Nautilus.

Zorin OS 16 is using Gnome 3.38 and Nautilus version 1:3.36.3-0ubuntu1.20.04.2. Your Gnome Desktop Environment and shell are 3.38.

Gnome 3.38 is the latest and last GTK3 version.

Gnome has recently introduced GTK4 and set the new gnome as Gnome 40 (Not 4.0). Gnome quickly released 41, 42 and 43 versions in a short amount of time, due to Gnome 40 being... quite new and green...

You are not able to "upgrade" Gnome on Zorin OS to Gnome 43. It calls upon too many system files that would need to also be adjusted and replaced.

Gnome 40+ and GTK4 have both caused a lot of ripples and rifts in Linux. They enhanced some features and made som major improvements and bug fixes. But they also removed a lot of features, including essential Desktop Features from the GTK toolkit and this affects all GTK desktops including XFCE, Cinnamon, Mate and so on. They instituted LibAdwaita, that locks their preferences in, regardless of the Distro or the User's wishes. Normally, we would all just look forward to the next version.

But this time, it is quite different. We are now heavily divided as Gnome uses force to dominate the Linux Desktop. Those that support it are feverish about voicing their support. Those who do not are feverish in voicing their dismay and warning of what this will bring in the future (I had previously warned about Gnome pulling a stunt like this and sure enough several months later, LibAdwaita was announced.) To put this into perspective, much of what Gnome Devs are doing is what upset people with what Microsoft does with Windows.

There are many caught in between that find the drama and conflict confusing and are less concerned about which side to pick as much as they are annoyed at having the prospect of having to choose a stinkin side.

It seems likely to me that the ZorinGroup will proceed with Gnome43 in Zorin OS 17.

To me, personally, this is akin to lending support to a company that uses a product that tortures animals. I loath it. When Zorin OS 17 is released, I am undecided as to what direction I may go in. I may move on to another distro and may participate on their support forum. Or, I may move on to other interests in projects. Or I may continue to try to help out on the Zorin Forum for all non-gnome issues.

Lich-Corals commented 1 year ago

I have just set up a Zorin os 16 in a virtual machine, I didn't get any errors in the dependency installation, but the console spams TypeError: get_file_items() takes 2 positional arguments but 3 were given when i run nautilus. That's the point where I don't know what to do, get_file_items() is a function in the script, that's (as far as I know) called when a file has been clicked, but I only see 'self' and 'files' as arguments. Maybe @derVedro knows what to do here. @Intellectual234 you can try running the command nautilus in a terminal window, to see if you get the same error, then we know that's definitely a problem with the script.

Username23453 commented 1 year ago

@Lich-Corals , thank you for trying. I got the same exact error in my terminal when i tried it, but not when i ran nautilus by itself . Please continue to try to solve it, in the meantime: 1.) I will post your issue/error in the Zorin Forum, they probably will be able to help. 2.) I was able to find a terminal script that converts images to PNG, its not GUI, his github is written poorly, i cant even figure out if the creator is trying to even imply its also GUI & has a pull down menu feature too. The github is: (LINK) It only converts one image at a time, not bulk.


Here are some other methods I've found: https://forum.zorin.com/t/i-am-trying-to-get-a-right-click-menu-option-that-converts-any-image-to-png-need-help/25597/4

VVVV-- Below method only will convert one image at a time. First of all install Nemo File manager https://itsfoss.com/install-nemo-file-manager-ubuntu/

Follow these instructions: https://brushingupscience.com/2017/02/28/image-conversion-with-a-right-click/

/home/username123/.local/share/nemo/scripts

file paths: /home/username123/.local/share/nemo/actions


https://www.fosslinux.com/3381/how-to-resize-convert-images-from-right-click-menu-in-ubuntu.htm

This is too hard to do: https://askubuntu.com/questions/156484/how-do-i-install-python-imaging-library-pil


"In Ubuntu 20.04, users can build a right-click option for converseen by installing Arc-menu Gnome Shell extension (sudo apt install gnome-shell-extension-arc-menu) and reinstalling Grub2 (sudo apt install grub) using the Terminal in the live environment.0"


https://atareao.es/ubuntu/convertir-archivos-svg-a-png-de-forma-masiva-en-ubuntu/

derVedro commented 1 year ago

I have just set up a Zorin os 16 in a virtual machine, I didn't get any errors in the dependency installation, but the console spams TypeError: get_file_items() takes 2 positional arguments but 3 were given when i run nautilus. That's the point where I don't know what to do, get_file_items() is a function in the script, that's (as far as I know) called when a file has been clicked, but I only see 'self' and 'files' as arguments. Maybe @derVedro knows what to do here. @Intellectual234 you can try running the command nautilus in a terminal window, to see if you get the same error, then we know that's definitely a problem with the script.

13 should fix it

Username23453 commented 1 year ago

@derVedro , :o I cant believe it, it works! its beautiful, simple, elegent, & can even do bulk! :D -Thank you!

Username23453 commented 1 year ago

@derVedro , @Lich-Corals , just curious, anyway to get this to work in nemo file manager, as nemo is the only file manager i know that allows the feature to double click of mouse to rename folder/file quickly. Also nemo shows "filesystem/root" shortcut in left hand column unlike Nautilus. :) Although, google drive appears to work better with nautilus than nemo.

derVedro commented 1 year ago

@derVedro , @Lich-Corals , just curious, anyway to get this to work in nemo file manager, as nemo is the only file manager i know that allows the feature to double click of mouse to rename folder/file quickly. Also nemo shows "filesystem/root" shortcut in left hand column unlike Nautilus. :) Although, google drive appears to work better with nautilus than nemo.

My first guess is yes, nemo is a nautilus fork, that would be quite similar.

  1. May be some imports changes to the source code: from gi.repository import Nemo, GObject
  2. And an different install directory. The script goes into ~/.local/shar/nemo-python/extensions
  3. I think you need some kind of nemo-python package to run it.

Probably something like this will work, sorry, I can not test it, but you can try.

ps. If you wanna quickly rename stuff, use F2 key.