Select to view content in your preferred language

Error installing .tar.bz2

1454
7
Jump to solution
03-11-2024 06:16 AM
CS_IBM
by
Occasional Contributor

Greetings,
I am following the  ArcGIS API for Python instructions. Where it states: "conda install /path_to_package_download_"

Which is the correct tar.bz for Python 3.11??

I used the conda consul install using:
"conda install \Users\ci000030\Downloads\win-64_arcgis-2.1.0-py39_3211.tar.bz2"

I got the following errors below.  Can anyone assist to resolve the errors??


Downloading and Extracting Packages:

Preparing transaction: done
Verifying transaction: done
Executing transaction: / Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'certifi'
Traceback (most recent call last):
File "<frozen runpy>", line 189, in _run_module_as_main
File "<frozen runpy>", line 112, in _get_module_details
File "C:\Users\ci000030\AppData\Local\anaconda3\envs\defra\Lib\site-packages\arcgis\__init__.py", line 3, in <module>
from arcgis.auth.tools import LazyLoader
File "C:\Users\ci000030\AppData\Local\anaconda3\envs\defra\Lib\site-packages\arcgis\auth\__init__.py", line 1, in <module>
from .api import EsriSession
File "C:\Users\ci000030\AppData\Local\anaconda3\envs\defra\Lib\site-packages\arcgis\auth\api.py", line 17, in <module>
from requests.sessions import Session
ModuleNotFoundError: No module named 'requests'

done
ERROR conda.core.link:_execute(945): An error occurred while installing package '<unknown>::arcgis-2.1.0-py39_3211'.
Rolling back transaction: done

LinkError: post-link script failed for package <unknown>::arcgis-2.1.0-py39_3211
location of failed script: C:\Users\ci000030\AppData\Local\anaconda3\envs\defra\Scripts\.arcgis-post-link.bat
==> script messages <==
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'certifi'
Traceback (most recent call last):
File "<frozen runpy>", line 189, in _run_module_as_main
File "<frozen runpy>", line 112, in _get_module_details
File "C:\Users\ci000030\AppData\Local\anaconda3\envs\defra\Lib\site-packages\arcgis\__init__.py", line 3, in <module>
from arcgis.auth.tools import LazyLoader
File "C:\Users\ci000030\AppData\Local\anaconda3\envs\defra\Lib\site-packages\arcgis\auth\__init__.py", line 1, in <module>
from .api import EsriSession
File "C:\Users\ci000030\AppData\Local\anaconda3\envs\defra\Lib\site-packages\arcgis\auth\api.py", line 17, in <module>
from requests.sessions import Session
ModuleNotFoundError: No module named 'requests'

==> script output <==
stdout: jupyter nbextension command failed: map widgets in the jupyter notebook may not work, installation continuing...

stderr:
return code: 1

 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Brian_Wilson
Honored Contributor

It only matters what conda thinks. If you want to work from inside ArcGIS Pro then go into Projects and open Package Manager, next to "Active Environment" click on the Gear icon. This is the "Environment Manager".  You can put your conda environments anywhere convenient for you. For me when I did a "clone" of the default environment, Pro suggested "C:\Users\bwilson\AppData\Local\ESRI\conda\envs\" but you can choose anywhere. Like I just made one in "arcproclones". Also note the folder I circled in red, you can also add existing folders by clicking there.

Brian_Wilson_0-1710181691364.png

See also https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/what-is-conda.htm

 

View solution in original post

0 Kudos
7 Replies
jcarlson
MVP Esteemed Contributor

It looks like your env is missing some of the dependencies of the ArcGIS Python API.

You're better off using the command conda install arcgis -c esri to install the API from Esri's conda channel.

If you would rather use the file-based approach, try adding the parameter --no-deps to install the API without checking for dependencies.

- Josh Carlson
Kendall County GIS
0 Kudos
CS_IBM
by
Occasional Contributor

Hi Josh,

I am doing an offline installation.

When I run: conda install arcgis -c esri

I get the following errors:

C:\Users\ci000030>conda install arcgis -c esri
Channels:
- esri
- defaults
Platform: win-64
Collecting package metadata (repodata.json): - WARNING conda.conda_libmamba_solver.index:_json_path_to_repo_info(281): No repodata found for channel esri. Solve will fail.
WARNING conda.conda_libmamba_solver.index:_json_path_to_repo_info(281): No repodata found for channel esri. Solve will fail.
done
Solving environment: failed

LibMambaUnsatisfiableError: Encountered problems while solving:
- nothing provides geomet needed by arcgis-2.1.0-py39_3211

Could not solve for environment specs
The following package could not be installed
└─ arcgis is not installable because it requires
└─ geomet, which does not exist (perhaps a missing channel).

0 Kudos
jcarlson
MVP Esteemed Contributor

Did you try adding --no-deps?

conda install \Users\ci000030\Downloads\win-64_arcgis-2.1.0-py39_3211.tar.bz2 --no-deps

- Josh Carlson
Kendall County GIS
Brian_Wilson
Honored Contributor

I tried to answer a conda question a couple weeks ago and I did not get the "I am offline" part then. The best answer I saw for that question was "Do the install on an online machine then copy."

Ultimately you have to download packages then copy so we're talking about what is easiest. Try to figure out dependencies and download a bunch of files or let conda figure it out and copy one folder. Conda does a nice job of putting everything it installs into one folder. So, when you have access online, install everything you need into an environment. Then transfer the environment folder via for example a thumb drive.

You have to know where the environment lives to copy it. For example,

$ conda env list
# conda environments:
#
arcgispro-py3            C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3
binder                   C:\Users\bwilson\.conda\envs\binder
codecompliance           C:\Users\bwilson\.conda\envs\codecompliance
flask                    C:\Users\bwilson\.conda\envs\flask
flask-oauth              C:\Users\bwilson\.conda\envs\flask-oauth
surveys                  C:\Users\bwilson\.conda\envs\surveys
base                     C:\Users\bwilson\Miniconda3

so I'd copy everything from "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3" if I wanted arcgispro-py3.

On the destination machine I could do "conda info" and look at the "envs directories". Then I could put the folder from the thumb drive into any of those paths that I can write to, for example, "C:\Users\bwilson\AppData\Local\ESRI\conda\envs"

I could also add the thumb drive to the list of directories in my conda config file, .condarc, which currently looks like this:

channels:
  - conda-forge
  - defaults
envs_dirs:
  - C:/Program Files/ArcGIS/Pro/bin/Python/envs
  - C:/Users/bwilson/AppData/Local/ESRI/conda/envs

 

If I added say "    - D:/" to the end then if my thumbdrive shows up as 😧 I would not have to copy anything.

 

Brian_Wilson
Honored Contributor

I love how the editor interpreted my attempt to type a "D:/" drive as an unhappy face.

0 Kudos
CS_IBM
by
Occasional Contributor

I have the following folders under \user\Appdata\Local

C:\Users\ci000030\AppData\Local\anaconda3\envs\arcgispro-py3
C:\Users\ci000030\AppData\Local\conda
C:\Users\ci000030\AppData\Local\ESRI\ArcGISPro

Should the ARGISPro folder be under \Local\Anaconda or \Local\Conda??

Should i have a conda folder under \Local\ESRI??

0 Kudos
Brian_Wilson
Honored Contributor

It only matters what conda thinks. If you want to work from inside ArcGIS Pro then go into Projects and open Package Manager, next to "Active Environment" click on the Gear icon. This is the "Environment Manager".  You can put your conda environments anywhere convenient for you. For me when I did a "clone" of the default environment, Pro suggested "C:\Users\bwilson\AppData\Local\ESRI\conda\envs\" but you can choose anywhere. Like I just made one in "arcproclones". Also note the folder I circled in red, you can also add existing folders by clicking there.

Brian_Wilson_0-1710181691364.png

See also https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/what-is-conda.htm

 

0 Kudos