Ubuntu22.04 で ラズパイゼロWからのダイレクト TCP ストリーミングでの配信されている画像を OpenCV で再生 その2
今回は今後に必要なパッケージ関連のインストール
https://pytorch.org/get-started/locally/
で
PyTorch Build Stable
Your OS Linux
Package pip
Language Python
Compute Platform CPU
を選択すると
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
が表示されるので
これを sudo をつけて実行する
sudo pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
これでインストール後に
python3 -c "import torch; print( torch.__version__ )"
で
2.0.1+cpu
というようにバージョンがでれば成功
次に機械学習フレームワークのChainerインストールを入れようとしたけど
GPUないので断念
次にpythonパッケージ関連
sudo apt -y update sudo apt -y install libgeographic-dev gdal-bin gdal-data libgdal-dev sudo apt -y install python3-numpy python3-scipy python3-h5py python3-sklearn python3-skimage python3-seaborn python3-pandas python3-pil cython3 python3-pytest python3-yaml cython3 python3-statsmodels python3-plotly python3-sympy python3-csvkit python3-docopt python3-pyproj python3-flake8 python3-protobuf python3-bs4 python3-html5lib python3-rope python3-wrapt python3-cffi python3-wheel python3-six python3-sphinx python3-bottleneck python3-pygments python3-numexpr python3-xlrd python3-xlwt python3-lxml python3-graphviz python3-pydot python3-flask python3-django python3-redis python3-pylint-common python3-bz2file python3-opengl python3-msgpack python3-mecab python3-matplotlib-venn python3-pygame python3-bottle python3-rtree python3-shapely python3-fiona python3-gdal python3-geopandas python3-geopy python3-geographiclib python3-requests
を実行したが
E: パッケージ python3-bz2file が見つかりません
となる
なので
sudo apt -y install python3-numpy python3-scipy python3-h5py python3-sklearn python3-skimage python3-seaborn python3-pandas python3-pil cython3 python3-pytest python3-yaml cython3 python3-statsmodels python3-plotly python3-sympy python3-csvkit python3-docopt python3-pyproj python3-flake8 python3-protobuf python3-bs4 python3-html5lib python3-rope python3-wrapt python3-cffi python3-wheel python3-six python3-sphinx python3-bottleneck python3-pygments python3-numexpr python3-xlrd python3-xlwt python3-lxml python3-graphviz python3-pydot python3-flask python3-django python3-redis python3-pylint-common python3-opengl python3-msgpack python3-mecab python3-matplotlib-venn python3-pygame python3-bottle python3-rtree python3-shapely python3-fiona python3-gdal python3-geopandas python3-geopy python3-geographiclib python3-requests
で実行
その後
sudo pip3 install -U pandasql pyyaml bokeh pymc3 mkl mkl-include holoviews pandas-bokeh ggplot prettyplotlib pybrain3 firebase-admin googletrans google-cloud-vision gpyocr azure-cognitiveservices-vision-computervision gensim gloo scikit-video scikits.datasmooth scikits.example scikits.fitting scikits.optimization scikits.vectorplot zodb gdata pyr2 pycaret
を実行するが
Collecting gpyocr Downloading gpyocr-1.6.tar.gz (10 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error × python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [10 lines of output] Traceback (most recent call last): File "<string>", line 2, in <module> File "<pip-setuptools-caller>", line 34, in <module> File "/tmp/pip-install-n3wh9blx/gpyocr_6b1e72dbc11046ffb50fbda9785e8f40/setup.py", line 3, in <module> from gpyocr import __version__ File "/tmp/pip-install-n3wh9blx/gpyocr_6b1e72dbc11046ffb50fbda9785e8f40/gpyocr/__init__.py", line 9, in <module> from ._gpyocr import ( File "/tmp/pip-install-n3wh9blx/gpyocr_6b1e72dbc11046ffb50fbda9785e8f40/gpyocr/_gpyocr.py", line 24, in <module> from google.cloud import vision ImportError: cannot import name 'vision' from 'google.cloud' (unknown location) [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.
となる
とりあえず他のものをインストール
sudo pip3 install git+https://github.com/jrosebr1/imutils.git python3 -c "import imutils; print(imutils.__version__)"
でバージョン確認
0.5.4
sudo pip3 install git+https://github.com/DinoTools/python-overpy.git python3 -c "import overpy; print(overpy.__version__)"
でバージョン確認
0.6
sudo pip3 install git+https://github.com/ianare/exif-py.git python3 -c "import exifread; print(exifread.__version__)"
でバージョン確認
3.1.0
sudo pip3 install git+https://github.com/mapado/haversine.git sudo pip3 install git+https://github.com/Turbo87/utm.git
次に
folium, pyproj, rtree, shapely, GDAL, fiona, geopandas のインストール
sudo apt -y update cd /usr/local sudo rm -rf geopandas sudo git clone https://github.com/geopandas/geopandas cd geopandas sudo python3 setup.py build sudo python3 setup.py build
を実行すると
Failed to load config from /usr/local/geopandas/pyproject.toml: 'versioneer' Try to load it from setup.cfg running build
となる
それでも
sudo python3 setup.py install
を実行すると
Failed to load config from /usr/local/geopandas/pyproject.toml: 'versioneer' Try to load it from setup.cfg running install /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( /usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( running bdist_egg running egg_info creating geopandas.egg-info writing geopandas.egg-info/PKG-INFO writing dependency_links to geopandas.egg-info/dependency_links.txt writing top-level names to geopandas.egg-info/top_level.txt writing manifest file 'geopandas.egg-info/SOURCES.txt' reading manifest file 'geopandas.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' adding license file 'LICENSE.txt' writing manifest file 'geopandas.egg-info/SOURCES.txt' Failed to load config from /usr/local/geopandas/pyproject.toml: 'versioneer' Try to load it from setup.cfg installing library code to build/bdist.linux-x86_64/egg running install_lib warning: install_lib: 'build/lib' does not exist -- no Python modules to install creating build creating build/bdist.linux-x86_64 creating build/bdist.linux-x86_64/egg creating build/bdist.linux-x86_64/egg/EGG-INFO copying geopandas.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO copying geopandas.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying geopandas.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying geopandas.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO zip_safe flag not set; analyzing archive contents... creating dist creating 'dist/geopandas-0.14.0+1.g91d1889-py3.10.egg' and adding 'build/bdist.linux-x86_64/egg' to it removing 'build/bdist.linux-x86_64/egg' (and everything under it) Processing geopandas-0.14.0+1.g91d1889-py3.10.egg Copying geopandas-0.14.0+1.g91d1889-py3.10.egg to /usr/local/lib/python3.10/dist-packages Adding geopandas 0.14.0+1.g91d1889 to easy-install.pth file Installed /usr/local/lib/python3.10/dist-packages/geopandas-0.14.0+1.g91d1889-py3.10.egg Processing dependencies for geopandas==0.14.0+1.g91d1889 Finished processing dependencies for geopandas==0.14.0+1.g91d1889
となるのでインストールできているっぽい
sudo pip3 install -q git+https://github.com/python-visualization/folium.git
次にpyenv のインストール
既にインストール済み
念の為ライブラリ関連も入れておく予定だったが
インストール済みだった
udo apt -y install --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev