Difficulty installing Chia on CentOS

I followed the instructions in INSTALL · Chia-Network/chia-blockchain Wiki · GitHub.
However, im not able to run the chia command line:

[root@hp5 ~]# chia -h
-bash: chia: command not found

Is there some missing step?

sudo yum update -y

# Compiling python 3.7 is generally required on CentOS 7.7 and newer
sudo yum install gcc openssl-devel bzip2-devel zlib-devel libffi libffi-devel -y
sudo yum install libsqlite3x-devel -y
# possible that on some RHEL based you also need to install
sudo yum groupinstall "Development Tools" -y
sudo yum install python3-devel gmp-devel  boost-devel libsodium-devel -y

sudo wget https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tgz
sudo tar -zxvf Python-3.7.7.tgz ; cd Python-3.7.7
./configure --enable-optimizations; sudo make -j$(nproc) altinstall; cd ..

# Download and install the source version
git clone https://github.com/Chia-Network/chia-blockchain.git -b latest
cd chia-blockchain

sh install.sh
. ./activate

Did running sh install.sh do anything?

Yes, the install did work, but when I rebooted and tried to run chia it wasn’t installed in the directory. I found a chia executable under /root/chia-blockchain/venv/bin/chia and ran that manually. It complained about paths and libraries, so I searched for those and added then in my profile configuration. After that, I was able to get it running:

[root@hp5 ~]# /root/chia-blockchain/venv/bin/chia plots create -h
Traceback (most recent call last):
  File "/root/chia-blockchain/venv/bin/chia", line 33, in <module>
    sys.exit(load_entry_point('chia-blockchain', 'console_scripts', 'chia')())
  File "/root/chia-blockchain/chia/cmds/chia.py", line 77, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "/root/chia-blockchain/venv/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/root/chia-blockchain/venv/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/root/chia-blockchain/venv/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/root/chia-blockchain/venv/lib/python3.7/site-packages/click/core.py", line 1256, in invoke
    Command.invoke(self, ctx)
  File "/root/chia-blockchain/venv/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/root/chia-blockchain/venv/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/root/chia-blockchain/venv/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/root/chia-blockchain/chia/cmds/plots.py", line 34, in plots_cmd
    raise RuntimeError("Please initialize (or migrate) your config directory with 'chia init'")
RuntimeError: Please initialize (or migrate) your config directory with 'chia init'
[root@hp5 ~]# /root/chia-blockchain/venv/bin/chia init
Chia directory /root/.chia/mainnet
Can't find private CA, creating a new one in /root/.chia/mainnet to generate TLS certificates
No keys are present in the keychain. Generate them with 'chia keys generate'

To see your keys, run 'chia keys show'

Don’t run it directly like that.

Go to that folder /root/chia-blockchain and type: . ./activate that should activate the chia command and setup all the paths etc.

Then you can run the chia plots create -h or other commands.

1 Like
[root@hp5 chia-blockchain]# . ./activate
(venv) [root@hp5 chia-blockchain]# chia -h
Usage: chia [OPTIONS] COMMAND [ARGS]...

  Manage chia blockchain infrastructure (1.1.2.dev11)

  --root-path PATH  Config file root  [default: /root/.chia/mainnet]
  -h, --help        Show this message and exit.

  configure   Modify configuration
  farm        Manage your farm
  init        Create or migrate the configuration
  keys        Manage your keys
  netspace    Estimate total farmed space on the network
  plots       Manage your plots
  run_daemon  Runs chia daemon
  show        Show node information
  start       Start service groups
  stop        Stop services
  version     Show chia version
  wallet      Manage your wallet

  Try 'chia start node', 'chia netspace -d 192', or 'chia show -s'

So, you have to run activate in each window you open? Ill just add the activate to the script which launches the plotting jobs and see how that goes. Thanks

Yes - that will create the virtual env (not sure if right terminology) with all paths etc in place. So if you put in script, that should be one of the things you run before the other command(s). Good luck