create account

How to Install Beem Python on Termux - Update by anthonyadavisii

View this thread on: hive.blogpeakd.comecency.com
· @anthonyadavisii · (edited)
$31.02
How to Install Beem Python on Termux - Update
    There have been a few changes in the requirements needed to install Beem on Termux. I will be sharing those requirements in this guide. Additionally, will be submitting a pull request for these updates to be included in the official readme.

https://siasky.net/TACT4TzsSBtoXJHNb5xSBJ-zFUN_xGkIAvGUkEt-rmxDcg/ZomboMeme15012022101907.jpg

# Repository:

https://github.com/holgern/beem

> Termux is a free and open source terminal emulator for Android which allows for running a Linux environment on an Android device. In addition, various software can be installed through the application's package manager.
 
[Wiki Source](https://en.m.wikipedia.org/wiki/Termux)

    During the process of troubleshooting my new install on my Samsung Galaxy Tab Lite A7, I learned that the current Google Play release of Termux is not well-maintained. When attempting to update packages, it was discovered that there are broken links to the repositories this release points. 

    This results in non-functional installs for Clang, Termux's C++ compiler, that, in turn results in failure to install the Python cryptography modules leveraged by Beem. It may be possible to install without said module; however, such is less than ideal as @holger80 recommends the module for the following reason:

> Signing and Verify can be fasten (200 %) by installing cryptography (you may need to replace pip3 by pip)

    Fortunately, there is a version of Termux available that is better maintained on the f-droid app marketplace without this issue. Use the following steps:

1\. Install [f-droid](https://f-droid.org). You may be asked to grant permissions to Install Unknown Apps. Grant the permission from whichever provider you desire to install the app i.e. file manager.

https://siasky.net/HAHv4aHGyrPDIUHkFrka6RDEuzZf6Bjj-afN1vVeqChwxw/Screenshot_20220115-093559_Settings.jpg

2\. Install Termux via the f-droid marketplace. Again, grant the permission to Install Unknown Apps

https://siasky.net/BAAoRSwGmV5n6c4sol34fSFTVvxCsStf9UrqDqBn_DkkIQ/SmartSelect_20220115-094201_F-Droid.jpg

3\. Now, open the Termux application and issue the first command as follows:
```
pkg install clang rust python
```
https://siasky.net/PAKxdDxJA6LNgDMIliSL5ctSnKXdgLCKmC_my9u9lD9mUA/SmartSelect_20220115-094645_Termux.jpg
Type 'Y' when prompted.

    Per the [cryptography.io documentation](https://cryptography.io/en/latest/faq/#why-does-cryptography-require-rust), Rust is now a requirement for the following reason:

> ### Why does cryptography require Rust?
> cryptography uses OpenSSL (see: Use of OpenSSL) for its cryptographic operations. OpenSSL is the de facto standard for cryptographic libraries and provides high performance along with various certifications that may be relevant to developers. However, it is written in C and lacks memory safety. We want cryptography to be as secure as possible while retaining the advantages of OpenSSL, so we’ve chosen to rewrite non-cryptographic operations (such as ASN.1 parsing) in a high performance memory safe language: Rust.

4\. Set the CARGO_BUILD_TARGET environmental variable used by rust.

    In order to prevent the following error, it is necessary to determine your rust target architecture and accordingly set the CARGO_BUILD_TARGET environmental variable.

```
error: Don't know the correct rust target for system type aarch64-unknown-linux-android. Please set the CARGO_BUILD_TARGET environment variable.
```
    After a bit of research, I found the correct procedure to resolve this issue via the following Github [users](https://github.com/japanese-xevvo) [bug report](https://github.com/pyca/cryptography/issues/6679).

    They did take a bit of flak due to the nature of their report but, thankfully for us, that user was able to find the solution despite it. Here are the steps to set the appropriate CARGO_BUILD_TARGET:
```
rustc --print target-list
```
    This will enumerate all processor / OS architectures that may be targeted. I was able to easily deduce mine based on the build messages but that isn't necessary. 

- Do you know the processor type of your device? 
- Do you know it's operating system? 

    With this information you should be able to deduce as well but, if you are having difficulty, you could just run "pip install cryptography" and then note the build messages. Example:
```
...
creating build/lib.linux-aarch64-3.10/cryptography
  copying src/cryptography/__about__.py -> build/lib.linux-aarch64-3.10/cryptography
  copying src/cryptography/__init__.py -> build/lib.linux-aarch64-3.10/cryptography
...
```

    In my case, the appropriate target was 'aarch64-linux-android' and, so then, I was able to set the environmental variable using the following command:

```
export CARGO_BUILD_TARGET=aarch64-linux-android
```

    Before attempting to install cryptography, you may want to install the wheel module. Do so with the 'pip install wheel' command. It wasn't necessary in my case but it may speed up your installation.

*Congratulations! We've made it to our last couple of steps. Now, issue the following command to install cryptography.*

5\. Install the Python cryptography module.

```
pip install cryptography
```
6\. Install Beem Python library.

Finally, we are ready to install Beem. Do so with the following command:

```
pip install beem
```

https://siasky.net/fATmIvXvT_C80_kFYGkvKkzPvuBr-N3yr4v1wBGejF9Sew/SmartSelect_20220115-101356_Termux.jpg
### Success! 

https://siasky.net/fAAEx74EXE82pFp94FqFPW-nEu671Ywo42b9V2pvJTmGHw/tenor.gif

*Note: All included images in this guide are self-hosted on SiaSky, a SiaCoin Skynet powered CDN provider.*

### Let me know if you have any questions or happen to hit a snag! Glad to help!
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 103 others
👎  
properties (23)
authoranthonyadavisii
permlinkhow-to-install-beem-python
categoryhive-136515
json_metadata{"links":["https://github.com/holgern/beem","https://en.m.wikipedia.org/wiki/Termux","https://f-droid.org","https://cryptography.io/en/latest/faq/#why-does-cryptography-require-rust","https://github.com/japanese-xevvo","https://github.com/pyca/cryptography/issues/6679"],"image":["https://siasky.net/TACT4TzsSBtoXJHNb5xSBJ-zFUN_xGkIAvGUkEt-rmxDcg/ZomboMeme15012022101907.jpg","https://siasky.net/HAHv4aHGyrPDIUHkFrka6RDEuzZf6Bjj-afN1vVeqChwxw/Screenshot_20220115-093559_Settings.jpg","https://siasky.net/BAAoRSwGmV5n6c4sol34fSFTVvxCsStf9UrqDqBn_DkkIQ/SmartSelect_20220115-094201_F-Droid.jpg","https://siasky.net/PAKxdDxJA6LNgDMIliSL5ctSnKXdgLCKmC_my9u9lD9mUA/SmartSelect_20220115-094645_Termux.jpg","https://siasky.net/fATmIvXvT_C80_kFYGkvKkzPvuBr-N3yr4v1wBGejF9Sew/SmartSelect_20220115-101356_Termux.jpg","https://siasky.net/fAAEx74EXE82pFp94FqFPW-nEu671Ywo42b9V2pvJTmGHw/tenor.gif"],"thumbnails":["https://siasky.net/TACT4TzsSBtoXJHNb5xSBJ-zFUN_xGkIAvGUkEt-rmxDcg/ZomboMeme15012022101907.jpg","https://siasky.net/HAHv4aHGyrPDIUHkFrka6RDEuzZf6Bjj-afN1vVeqChwxw/Screenshot_20220115-093559_Settings.jpg","https://siasky.net/BAAoRSwGmV5n6c4sol34fSFTVvxCsStf9UrqDqBn_DkkIQ/SmartSelect_20220115-094201_F-Droid.jpg","https://siasky.net/PAKxdDxJA6LNgDMIliSL5ctSnKXdgLCKmC_my9u9lD9mUA/SmartSelect_20220115-094645_Termux.jpg","https://siasky.net/fATmIvXvT_C80_kFYGkvKkzPvuBr-N3yr4v1wBGejF9Sew/SmartSelect_20220115-101356_Termux.jpg","https://siasky.net/fAAEx74EXE82pFp94FqFPW-nEu671Ywo42b9V2pvJTmGHw/tenor.gif"],"users":["holger80"],"tags":["hive-136515","beem","termux","hivedev","python","hive","android","proofofbrain","palnet","neoxian"],"app":"ecency/3.0.20-vision","format":"markdown+html"}
created2022-01-15 16:28:06
last_update2022-01-15 20:28:51
depth0
children19
last_payout2022-01-22 16:28:06
cashout_time1969-12-31 23:59:59
total_payout_value15.554 HBD
curator_payout_value15.468 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5,953
author_reputation196,074,471,102,788
root_title"How to Install Beem Python on Termux - Update"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id109,512,611
net_rshares20,888,693,803,255
author_curate_reward""
vote details (168)
@anthonyadavisii ·
Public Gist has been created.

https://gist.github.com/anthonyadavisii/d4552f04712bff947ad78a68f9a0245f
properties (22)
authoranthonyadavisii
permlinkre-anthonyadavisii-2022115t103249801z
categoryhive-136515
json_metadata{"tags":["hive-136515","beem","termux","hivedev","python","hive","android","proofofbrain","palnet","neoxian"],"app":"ecency/3.0.23-mobile","format":"markdown+html"}
created2022-01-15 16:32:51
last_update2022-01-15 16:32:51
depth1
children0
last_payout2022-01-22 16:32:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length103
author_reputation196,074,471,102,788
root_title"How to Install Beem Python on Termux - Update"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id109,512,752
net_rshares0
@anthonyadavisii ·
In case any were wondering, we don't have to install OpenSSL because it is already installed in the f-droid version of Termux.
properties (22)
authoranthonyadavisii
permlinkre-anthonyadavisii-2022115t10570589z
categoryhive-136515
json_metadata{"tags":["hive-136515","beem","termux","hivedev","python","hive","android","proofofbrain","palnet","neoxian"],"app":"ecency/3.0.23-mobile","format":"markdown+html"}
created2022-01-15 16:57:03
last_update2022-01-15 16:57:03
depth1
children0
last_payout2022-01-22 16:57:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length126
author_reputation196,074,471,102,788
root_title"How to Install Beem Python on Termux - Update"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id109,513,302
net_rshares0
@ecency ·
**Yay!** 🤗<br>Your content has been **boosted with Ecency Points**, by @anthonyadavisii. <br>Use Ecency daily to boost your growth on platform! <br><br><b>Support Ecency</b><br>[Vote for new Proposal](https://hivesigner.com/sign/update-proposal-votes?proposal_ids=%5B197%5D&approve=true)<br>[Delegate HP and earn more](https://ecency.com/hive-125125/@ecency/daily-100-curation-rewards)
properties (22)
authorecency
permlinkre-2022119t143134900z
categoryhive-136515
json_metadata{"tags":["ecency"],"app":"ecency/3.0.16-welcome","format":"markdown+html"}
created2022-01-19 14:31:36
last_update2022-01-19 14:31:36
depth1
children0
last_payout2022-01-26 14:31:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length385
author_reputation549,971,524,037,747
root_title"How to Install Beem Python on Termux - Update"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id109,647,733
net_rshares0
@pizzabot ·
<center>PIZZA! 


PIZZA Holders sent <strong>$PIZZA</strong> tips in this post's comments:
@steevc<sub>(5/5)</sub> tipped @anthonyadavisii (x1)


<sub>Join us in <a href="https://discord.gg/hivepizza">Discord</a>!</sub></center>
properties (22)
authorpizzabot
permlinkre-how-to-install-beem-python-20220115t173419z
categoryhive-136515
json_metadata"{"app": "beem/0.24.26"}"
created2022-01-15 17:34:21
last_update2022-01-15 17:34:21
depth1
children0
last_payout2022-01-22 17:34:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length228
author_reputation6,163,031,654,911
root_title"How to Install Beem Python on Termux - Update"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id109,514,222
net_rshares0
@poshtoken ·
$1.69
https://twitter.com/Alex_d_281/status/1482399783830659081
<sub> The rewards earned on this comment will go directly to the person sharing the post on Twitter as long as they are registered with @poshtoken. Sign up at https://hiveposh.com.</sub>
👍  , ,
properties (23)
authorposhtoken
permlinkre-anthonyadavisii-how-to-install-beem-python98308
categoryhive-136515
json_metadata"{"app":"Poshtoken 0.0.1"}"
created2022-01-15 17:24:03
last_update2022-01-15 17:24:03
depth1
children0
last_payout2022-01-22 17:24:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value1.690 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length245
author_reputation3,941,855,672,674,133
root_title"How to Install Beem Python on Termux - Update"
beneficiaries
0.
accountreward.app
weight10,000
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id109,513,910
net_rshares2,286,480,760,058
author_curate_reward""
vote details (3)
@steevc ·
$0.34
I'd not even thought of installing beem on Android. Could have some interesting applications. I did try putting it on a Raspberry Pi, but get errors when I import it in a script.
👍  , , ,
properties (23)
authorsteevc
permlinkre-anthonyadavisii-r5rgly
categoryhive-136515
json_metadata{"tags":["hive-136515"],"app":"peakd/2021.12.1"}
created2022-01-15 17:01:09
last_update2022-01-15 17:01:09
depth1
children13
last_payout2022-01-22 17:01:09
cashout_time1969-12-31 23:59:59
total_payout_value0.172 HBD
curator_payout_value0.169 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length178
author_reputation1,046,997,581,239,586
root_title"How to Install Beem Python on Termux - Update"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id109,513,374
net_rshares233,224,679,564
author_curate_reward""
vote details (4)
@anthonyadavisii ·
$0.30
Interesting, would like to hear more about the process you are using. So, you're able to install been but importing a script using the python imports fails? Am I understanding correctly?

Can't say I've installed on a pi but I do have a few that I could toy around with which I just might. 😉
👍  
properties (23)
authoranthonyadavisii
permlinkre-steevc-2022115t11654852z
categoryhive-136515
json_metadata{"tags":["hive-136515"],"app":"ecency/3.0.23-mobile","format":"markdown+html"}
created2022-01-15 17:06:57
last_update2022-01-15 17:06:57
depth2
children12
last_payout2022-01-22 17:06:57
cashout_time1969-12-31 23:59:59
total_payout_value0.151 HBD
curator_payout_value0.151 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length291
author_reputation196,074,471,102,788
root_title"How to Install Beem Python on Termux - Update"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id109,513,503
net_rshares205,036,458,596
author_curate_reward""
vote details (1)
@steevc ·
$0.35
I used pip to install it. 

> Python 3.9.2 (default, Mar 12 2021, 04:06:34) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
\>>> from beem import Hive
Illegal instruction

I think I have the latest version

> pi@raspberrypi:~ $ pip list|grep beem
beem             0.24.26

I did ask in the beem discord, but didn't get a response. I would think someone has it working on a Pi as they should be ideal for running a simple bot. That's what I want to do.

!PIZZA
👍  , , ,
properties (23)
authorsteevc
permlinkre-anthonyadavisii-r5ri3i
categoryhive-136515
json_metadata{"tags":["hive-136515"],"app":"peakd/2021.12.1"}
created2022-01-15 17:33:18
last_update2022-01-15 17:33:18
depth3
children11
last_payout2022-01-22 17:33:18
cashout_time1969-12-31 23:59:59
total_payout_value0.174 HBD
curator_payout_value0.172 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length514
author_reputation1,046,997,581,239,586
root_title"How to Install Beem Python on Termux - Update"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id109,514,191
net_rshares236,695,776,077
author_curate_reward""
vote details (4)