2025年2月6日木曜日

whl python ライブラリ 非インターネット

 


インターネットに接続できない環境で、Wheelファイルを使用することでPythonのパッケージのインストールが可能です。
今回は、IGWがアタッチされていない環境でEC2に、boto3をインストールします。

まとめ

  • pipを使わずに、whlファイルを使ってインストールします。

概要

Wheelファイルとは?

PEP427を参照すると、以下のように書かれています。

wheel は、特別な形式のファイル名と .whl 拡張子を持つ ZIP 形式のアーカイブです。特定のインストールスキームで PEP 376 に従ってインストールされるのとほぼ同じ単一のディストリビューションが含まれています。専用のインストーラーが推奨されますが、標準の「unzip」ツールを使用してサイト パッケージに展開するだけでホイール ファイルをインストールできます。

  • Wheelは、ZIP形式のアーカイブのこと。拡張子は、「.whl」。

実践

インターネットが繋がるPC上で、whlファイルをダウンロードし一旦S3に配置後、EC2からダウンロードしインストールします。

whlファイルのダウンロード

インターネットが繋がるPCで、boto3と関連するファイルをダウンロードし、S3にアップロードします。

curl https://files.pythonhosted.org/packages/23/d8/3b41ce8c96dedbb449f24de21eee0742786f414fea176f984b1101154f30/boto3-1.24.84-py3-none-any.whl -O
curl https://files.pythonhosted.org/packages/36/32/6ddb12143e32535550263514875db6d1a3ad50daf1377fbb1aac03a000aa/botocore-1.27.84-py3-none-any.whl -O
curl https://files.pythonhosted.org/packages/31/b4/b9b800c45527aadd64d5b442f9b932b00648617eb5d63d2c7a6587b7cafc/jmespath-1.0.1-py3-none-any.whl -O
curl https://files.pythonhosted.org/packages/36/7a/87837f39d0296e723bb9b62bbb257d0355c7f6128853c78955f57342a56d/python_dateutil-2.8.2-py2.py3-none-any.whl -O
curl https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl -O
curl https://files.pythonhosted.org/packages/6f/de/5be2e3eed8426f871b170663333a0f627fc2924cc386cd41be065e7ea870/urllib3-1.26.12-py2.py3-none-any.whl -O

aws s3 cp boto3-1.24.84-py3-none-any.whl s3://${バケット名}/ec2/
aws s3 cp botocore-1.27.84-py3-none-any.whl s3://${バケット名}/ec2/
aws s3 cp jmespath-1.0.1-py3-none-any.whl s3://${バケット名}/ec2/
aws s3 cp python_dateutil-2.8.2-py2.py3-none-any.whl s3://${バケット名}/ec2/
aws s3 cp six-1.16.0-py2.py3-none-any.whl s3://${バケット名}/ec2/
aws s3 cp urllib3-1.26.12-py2.py3-none-any.whl s3://${バケット名}/ec2/

インストール

EC2にログインし、先程、アップロードしたファイルをS3からダウンロード後、インストールします。

aws s3 cp s3://${バケット名}/ec2/boto3-1.24.84-py3-none-any.whl /home/ssm-user/
aws s3 cp s3://${バケット名}/ec2/botocore-1.27.84-py3-none-any.whl /home/ssm-user/
aws s3 cp s3://${バケット名}/ec2/mespath-1.0.1-py3-none-any.whl /home/ssm-user/
aws s3 cp s3://${バケット名}/ec2/python_dateutil-2.8.2-py2.py3-none-any.whl  /home/ssm-user/
aws s3 cp s3://${バケット名}/ec2/six-1.16.0-py2.py3-none-any.whl  /home/ssm-user/
aws s3 cp s3://${バケット名}/ec2/urllib3-1.26.12-py2.py3-none-any.whl  /home/ssm-user/


sh-4.2$ pwd
/home/ssm-user
sh-4.2$ ls -l
total 9528
-rw-r--r-- 1 ssm-user ssm-user  132500 Oct  1 15:13 boto3-1.24.84-py3-none-any.whl
-rw-r--r-- 1 ssm-user ssm-user 9189276 Oct  1 15:46 botocore-1.27.84-py3-none-any.whl
-rw-r--r-- 1 ssm-user ssm-user   20256 Oct  1 15:53 jmespath-1.0.1-py3-none-any.whl
-rw-r--r-- 1 ssm-user ssm-user  247702 Oct  1 15:58 python_dateutil-2.8.2-py2.py3-none-any.whl
-rw-r--r-- 1 ssm-user ssm-user   11053 Oct  1 16:05 six-1.16.0-py2.py3-none-any.whl
-rw-r--r-- 1 ssm-user ssm-user  140381 Oct  1 16:09 urllib3-1.26.12-py2.py3-none-any.whl
sh-4.2$

pip3 install  --no-deps ./boto3-1.24.84-py3-none-any.whl
pip3 install  --no-deps ./botocore-1.27.84-py3-none-any.whl
pip3 install  --no-deps ./mespath-1.0.1-py3-none-any.whl
pip3 install  --no-deps ./python_dateutil-2.8.2-py2.py3-none-any.whl
pip3 install  --no-deps ./six-1.16.0-py2.py3-none-any.whl
pip3 install  --no-deps ./urllib3-1.26.12-py2.py3-none-any.whl

sh-4.2$ pip3 list
Package           Version
----------------- -------
aws-cfn-bootstrap 2.0
boto3             1.24.84
botocore          1.27.84
docutils          0.14
jmespath          1.0.1
lockfile          0.11.0
pip               20.2.2
pystache          0.5.4
python-daemon     2.2.3
python-dateutil   2.8.2
setuptools        49.1.3
simplejson        3.2.0
six               1.16.0
urllib3           1.26.12
sh-4.2$

考察

インターネットに繋がらない環境で、環境を構築することはたまにあります。
忘れないようにメモとして残しておきます。

2025年1月21日火曜日

Ubuntu Mozoc Japanese

 

 

Ad.

Ubuntu20.04で日本語入力をするための設定方法をご紹介します。

【Ubuntu】日本語入力を有効にする(Mozc)

公式サイトからUbuntu20.04のイメージファイル(.iso)をダウンロードして、それをインストールすると、デフォルトでは日本語入力ができません。

ただし簡単に有効化することができますので、その方法を以下でまとめます。

手順

  1. ターミナル(端末)を開く
    Ctrl+Alt+Tを入力する(または右クリックで「Open in Teminal」をクリック)
  2. パッケージをアップデートする
    sudo apt update
      1_mozc
    • (求められたら)ご自身で設定したパスワードを入力する
  3. Mozcをインストールする
    sudo apt install ibus-mozc
      2_mozc
    • 「Y」を入力する
    • 3_mozc
  4. 再起動する
    sudo reboot
  5. 4_mozc
  6. 設定を開く
  7. 5_mozc
  8. インストールしたMozcを設定に追加する
  9. 6_mozc
    7_mozc
    8_mozc
  10. Mozcを選択する
  11. 9_mozc

さいごに

Ubuntu20.04でMozcを使う方法をご紹介しました。

参考になれば幸いです。

以上です。

Ad.

 

2025年1月15日水曜日

EASA OPEN civil drone

 


Open Category - Low Risk - Civil Drones

The ‘open’ category is the main reference for the majority of leisure drone activities and low-risk commercial activities.                  
As a drone operator, remember to check if you need to register yourself. See the registration FAQ.                 

The ‘open’ category is in turn subdivided in three sub-categories – A1, A2, A3 -- which may be summarised as follows:

  • A1: fly over people but not over assemblies of people
  • A2: fly close to people
  • A3: fly far from people

Each subcategory comes with its own set of requirements. Therefore, in the ‘open’ category, it is important to identify the subcategory of operation your activities will fall under, to determine which rules apply to you, and the type of training the remote pilot needs to undertake. See the FaQ ‘Which training I need to fly my drone in the open category’                 

Start by identifying the type of drone you own. 

Table for ‘Open’ category applicable since 1 January 2024

Drones_3


Drones with a class identification label  (i.e.  ,, , , , ,) are already available on the market. Please see the Approved Drones for EU Operations page that includes the list of drones that received the class identification label. If you want to purchase a drone with class identification, please check that the drone shows on its body the class identification and make sure that the drone has an EU Declaration of Conformity. Several versions of the same drone may be available, with and without class mark. You can find additional information on drones with a class identification label in the Drones Information Notices webpage.

Operations in the open category must be conducted with a drone:

  • bearing a C0 to C4 class identification label, or;
  • being privately built (built for your own use), or;
  • even without class identification label, but only if placed on the market before 31 December 2023.

Drones bearing a class identification label can be already utilised in accordance with the conditions shown in the menus below. Be aware that ‘privately built’ means that you built the drone for your own personal use, so it was not purchased; it does not refer to UASs assembled from sets of parts placed on the market as a single, ready-to-assemble kit.

How to operate drones in the open category

‘Open’ category using drones with a class identification label                 

* A State may lower the remote pilot minimum age to 12. In that case, the lowered age limit will apply only in that State.

You are invited to consult the Provisions applicable to both ‘open’ and ‘specific’ category FAQs  as well as Understanding the ‘open’ category FAQs for more details. These FAQs take you through all the steps you need to take to be fully compliant and help you identify the regulations that are applicable to the drone operations you intend to conduct.

For all our amateur drone pilots, Paul and his new drone Donnie will help you see how easy it is to become a safe and responsible drone pilot.

Remote identification

All drones operating in the open category (with limited exceptions) need to be equipped with a remote identification system. Some companies have already placed on the market modules providing a direct remote identification system, providing the ‘EU Declaration of Conformity’ and you can find a list below. Please be aware that EASA did not verify the compliance of such components and the declaration of conformity is submitted under the sole responsibility of the manufacturer.

EU Declaration of Conformity list

Manufacturer

Name of the module

Function

Website link

EU Declaration of Conformity

AerobitsidMEDirect remote identificationidME (Remote ID) MoC_eu_idme.pdf (aerobits.pl)
AerobitsidME+Direct remote identificationidME+ (Remote ID) MoC_eu_idmeplus.pdf (aerobits.pl)
AerobitsidME ProDirect remote identification

idME PRO (Remote ID)

MoC_eu_idmepro.pdf (aerobits.pl)
AirPlateAirPlate Remote ID ProDirect remote identificationAirPlate Remote ID ProEU Declaration of Conformity (airplate.dk)
BluemarkDB120Direct remote identificationDroneBeacon Battery - Remote ID transponder EU Declaration of Compliance (dronescout.co)
BluemarkDB121Direct remote identificationDroneBeacon db121 Remote ID transponder EU Declaration of Compliance (dronescout.co)
BluemarkDB121pcbDirect remote identificationDroneBeacon db121 Remote ID transponder EU Declaration of Compliance (dronescout.co)
BluemarkDB121fpvDirect remote identificationDroneBeacon FVP - Remote ID transponder EU Declaration of Compliance (dronescout.co)
BluemarkDB150Direct remote identificationDroneBeacon FVP - Remote ID transponder EU Declaration of Compliance (dronescout.co)
BluemarkDB152fpvDirect remote identificationDroneBeacon FVP - Remote ID transponder EU Declaration of Compliance (dronescout.co)
BluemarkDB153fpvDirect remote identificationDroneBeacon FVP - Remote ID transponder EU Declaration of Compliance (dronescout.co)
DronaviaFly ID   
Fly ID   
Fly ID light
Direct remote identificationDirect Remote ID (DRI) EU Declaration of Conformity (dronavia.com)
Drone DefenceAeropingDirect remote identificationAeroping | Drone Defence | Air traffic monitoring platform EU-Declaration-of-Conformity-AeroPing.pdf (dronedefence.co.uk)
DronetagBSDirect remote identificationDronetag BS – Bare minimum for Remote IDEU Declaration of Conformity
DronetagBeaconDirect remote identificationDronetag BeaconEU Declaration of Conformity
DronetagMiniDirect remote identificationDronetag MiniEU Declaration of Conformity
DronetagMini 4GDirect remote identificationDronetag MiniEU Declaration of Conformity
FLARMATOM UAVDirect remote identificationAtom UAVDeclaration of Compliance
FLARMAuroraDirect remote identificationAuroraDeclaration of Compliance
ItaldronItaldron Remote ITDirect remote identificationSales professional drones and UAV - ItaldronEU Declaration of Compliance

PrimeCor

PrimeCor Tracker

Direct remote identification

PrimeCor Tracker 

EU Declaration of Conformity (primecorsys.com)

TopView

Pollicino

Direct remote identification

TOPVIEW - Remote ID (Pollicino)

EU Declaration of Conformity 
(topview.it)

Zing Drone Solutions

Z-RID LITE

Direct remote identification

Zingdrones

EU Declaration of Conformity