INSTALL via Conda
Hello,
Here is my installation experience in a Conda environment thanks to a helpful Linux experience person. I share it to help people with limited Linux experience.
conda create --name fototex
conda activate fototex
pip install fototex
result in :
Collecting fototex
Using cached fototex-1.5.5.tar.gz (25 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6opd23s_/fototex/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6opd23s_/fototex/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-6opd23s_/fototex/pip-egg-info
cwd: /tmp/pip-install-6opd23s_/fototex/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-6opd23s_/fototex/setup.py", line 3, in <module>
import fototex
File "/tmp/pip-install-6opd23s_/fototex/fototex/__init__.py", line 18, in <module>
import gdal
ModuleNotFoundError: No module named 'gdal'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
We try with requirements.txt
of fototex repository but with gdal<3.3 :
requirements.txt
gdal>=2.3.3,<3.3
h5py>=2.9.0
matplotlib>=3.3.2
numpy>=1.17.2
numba>=0.48.0
scikit-learn>=0.21.3
tqdm>=4.42.0
With conda two much time :
conda install -c conda-forge --file Downloads/requirements.txt
So with manba :
conda install mamba
mamba install -c conda-forge --file Downloads/requirements.txt
result in :
Looking for: ["gdal[version='>=2.3.3,<3.3']", "h5py[version='>=2.9.0']", "matplotlib[version='>=3.3.2']", "numpy[version='>=1.17.2']", "numba[version='>=0.48.0']", "scikit-learn[version='>=0.21.3']", "tqdm[version='>=4.42.0']"]
iota2/noarch 130.0 B @ 352.0 B/s 0.4s
iota2/linux-64 5.4kB @ 8.8kB/s 0.6s
pkgs/r/linux-64 1.1MB @ 1.0MB/s 0.4s
pytorch/noarch 5.4kB @ 5.1kB/s 0.7s
pytorch/linux-64 132.5kB @ 116.0kB/s 1.1s
pkgs/r/noarch 482.4kB @ 360.8kB/s 0.3s
conda-forge/noarch 8.3MB @ 4.1MB/s 2.1s
pkgs/main/noarch 810.1kB @ 381.5kB/s 1.0s
pkgs/main/linux-64 4.5MB @ 1.2MB/s 2.6s
conda-forge/linux-64 23.2MB @ 4.1MB/s 5.9s
Pinned packages:
- python 3.10.*
Encountered problems while solving:
- package libxml2-2.9.14-h22db469_0 requires icu >=70.1,<71.0a0, but none of the providers can be installed
So re install with another python version :
conda deactivate
conda remove --name fototex --all
conda create --name fototex "python==3.8.*"
conda activate fototex
conda install mamba
mamba install -c conda-forge --file Downloads/requirements.txt
--> installation OK and after :
pip install fototex
results in :
Collecting fototex
Using cached fototex-1.5.5.tar.gz (25 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [8 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-dqyndq11/fototex_f9a186dcc1154e45a81ad78634c0ed29/setup.py", line 3, in <module>
import fototex
File "/tmp/pip-install-dqyndq11/fototex_f9a186dcc1154e45a81ad78634c0ed29/fototex/__init__.py", line 18, in <module>
import gdal
ModuleNotFoundError: No module named 'gdal'
[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.
Trying with another gdal version :
mamba install "gdal<3.2"
Results in these changes to confirm :
Package Version Build Channel Size
────────────────────────────────────────────────────────────────────────────────────
Change:
────────────────────────────────────────────────────────────────────────────────────
- geotiff 1.6.0 h08e826d_7 conda-forge
+ geotiff 1.6.0 h4f31c25_6 conda-forge/linux-64 306kB
- kealib 1.4.14 h87e4c3c_3 conda-forge
+ kealib 1.4.14 hcc255d8_2 conda-forge/linux-64 191kB
- libnetcdf 4.8.1 nompi_h329d8a1_102 conda-forge
+ libnetcdf 4.8.1 nompi_hcd642e3_100 conda-forge/linux-64 2MB
- libspatialite 5.0.1 h5cf074c_8 conda-forge
+ libspatialite 5.0.1 h8694cbe_6 conda-forge/linux-64 5MB
Downgrade:
────────────────────────────────────────────────────────────────────────────────────
- gdal 3.2.2 py38h81a01a0_11 conda-forge
+ gdal 3.1.4 py38hcba47de_18 conda-forge/linux-64 1MB
- h5py 3.6.0 nompi_py38hfbb2109_100 conda-forge
+ h5py 3.3.0 nompi_py38h9915d05_100 conda-forge/linux-64 1MB
- hdf5 1.12.1 nompi_h2386368_104 conda-forge
+ hdf5 1.10.6 nompi_h6a2412b_1114 conda-forge/linux-64 3MB
- libgdal 3.2.2 h57ec04e_11 conda-forge
+ libgdal 3.1.4 h07ae0cd_18 conda-forge/linux-64 13MB
- poppler 21.09.0 ha39eefc_3 conda-forge
+ poppler 21.03.0 h93df280_0 conda-forge/linux-64 17MB
- proj 8.1.0 h277dcde_1 conda-forge
+ proj 8.0.1 h277dcde_0 conda-forge/linux-64 3MB
Summary:
Change: 4 packages
Downgrade: 6 packages
Total download: 46MB
After trying another time:
pip install fototex
leads to a succssful install (with an error)
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
rioxarray 0.10.1 requires pyproj>=2.2, which is not installed.
rasterio 1.2.10 requires attrs, which is not installed.
rasterio 1.2.10 requires click>=4.0, which is not installed.
museotoolbox 0.13.6 requires psutil, which is not installed.
geopandas 0.10.2 requires pyproj>=2.2.0, which is not installed.
Successfully installed fototex-1.5.5 numpy-1.22.4
Now I will try to use it and share my use experience.
Thanks.
Edited by Josselin GIFFARD