Open Jacek-ghub opened 3 years ago
Install script checks python3 --version
and not python --version
. You probably have older version under python3
Thank you, I noticed that, and already fixed it, and got it working.
After installing p3.6.9, there was no python3 symlink created - only "python" still pointing to 2.7. So, I changed that symlink to point to the p3.9.6 binary, but I didn't initially create p3. Checking the install script, I added p3 symlink, and it started working. As I said, I am new to python, so I don't really know what is the proper installation, whether what I got is normal, or rather something went wrong.
As mentioned, I am on CentOS 7, as such the install.sh barfs on apt-get. RedHat derived OSes don't use that.
Also, that "sudo apt-get update" potentially should not be there. If that is the same as yum update on RedHat, it will force the user to update everything on the system, what may not be what the user is ready to do. I think that echoing those two lines and exiting the script would be a better idea. Another reason is that on RedHat you need to install libpython3-devel, as ...-dev is just for Debian based OSes.
And of course, dpkg also does not exist on RedHat based system.
I think that the install script should stick with its own code, not really be doing system level changes. I know it is tempting to do that, but you are just forcing your guesses against what the user decided to have. It is tempting, as it may be helping some people, but may cause issues for those that are for whatever reason not ready to do that. Just letting people know (echo) what needs to be done should be good enough (that note about wrong version helped me to fix the problem).
Also just noticed that "build-essential" looks like is not there under RedHat. Same for dpkg.
So, basically all those maintenance related lines are wrong if the OS is not Debian based.
These are very valid points, thanks for the feedback!
We should add explicit check for non-Debian based distributions and exit if we decide to keep the install script. And also ask user for confirmation before installing any missing dependencies.
sudo apt-get update
should be harmless, it only updates the list of packages. Actual upgrade of the packages is performed with sudo apt-get upgrade
which we do not invoke.
On RedHat side, "yum update" will update the whole box. The metadata update is always done internally before proceeding to the installation/update/upgrade part. Of course, if you don't do "-y" switch, command will stop asking for it, but you will need to have a really good explanation what and why you want to update before anyone will confirm that (that is the main reason for me to separate that script into OS related, and ChiaDog related, although that split may be a bit fuzzy).
Also, yum is not the only option, or rather not default. On CentOS 7 it is rpm, on v8 I think is dnf.
Although, RedHat is killing CentOS for time being, so maybe that is not something worth pursuing.
Lastly, looking at python guides, gentoo looks like have yet another python installation, where potentially they always install devel part.
Since you already have install.sh, maybe update.sh would be also nice. Yeah, those are only four lines, but that is what exactly small and useful scripts are. Seeing that, the next person will help to make it for Windows, etc.
I have a similar issue on truenas running a jail. There is this nifty chia plugin there that runs in a jail and where i run a harvester. I thought i kinda made it work by running the stuff in install.sh that is able to run but i get errors when starting the dog so i guess not :) I belive truenas runs on freebsd.
Error:
[root@san-chia-harvester ~/chiadog]# ./start.sh
Traceback (most recent call last):
File "main.py", line 13, in
Python 3.8.11
What i did to "manually" install it was:
python3 -m venv venv
. ./venv/bin/activate
python3 -m pip install --upgrade pip
pip3 install wheel && pip3 install -r requirements.txt
deactivate
and ./start.sh Error above.
Also, the reason i wanted to run the dog is that i've noticed that the harverster for some reason stops working, i know i can get notifications but could it alse be added as a feature that i actually restarts the harvester? Would save some time and effort.
Kind of a noob question.
I have just installed python 3.9.6 on CentOS 7, and am getting "Python 3.9.6" as a response to "python --version." I tried to run chiadog install.sh but got an error:
Chiadog requires Python 3.7+. Please update before proceeding with the installation
Do I need to drop the python version to 3.7?