Select to view content in your preferred language

Installing ArcGIS python package using pip breaks pip/virtual env

2946
12
04-06-2022 09:10 AM
CParker
New Contributor II

I am attempting to install ArcGIS python package in a clean virtual env. I'm running Python 3.10.4 currently. After running 'pip install arcgis' it looks like it installs correctly, but then nothing works. I cant run a script in that virtual env, I cant run any pip commands. The only option has been to delete the virtual env. 

Example errors after install, was running pip freeze:

 

 

Traceback (most recent call last):
  File "C:\Users\XXXX\AppData\Local\Programs\Python\Python310\lib\importlib\_common.py", line 89, in _tempfile
    os.write(fd, reader())
  File "C:\Users\XXXXX\AppData\Local\Programs\Python\Python310\lib\importlib\abc.py", line 371, in read_bytes
    with self.open('rb') as strm:
  File "C:\Users\XXXXX\AppData\Local\Programs\Python\Python310\lib\importlib\_adapters.py", line 54, in open
    raise ValueError()
ValueError

 

 

I have also tried installing arcgis with no dependencies and then installing the bare minimum, but then python complains that modules are missing and wont run a script with a arcgis import.

 

Any help would be greatly appreciated.

 

 

Tags (3)
0 Kudos
12 Replies
DanPatterson
MVP Esteemed Contributor

Were you following the links in the "What's Included" section of the following link for installations instructions for your appropriate environment?

Esri/arcgis-python-api: Documentation and samples for ArcGIS API for Python (github.com)


... sort of retired...
0 Kudos
CParker
New Contributor II

I was not. Since its hosted on PyPi I was just trying to install it via pip. I am not a fan of conda/anaconda. I literally just want to 'pip install arcgis' like it is listed on PyPi:

https://pypi.org/project/arcgis/

0 Kudos
CParker
New Contributor II

you all can ignore this question. I found how to do what I need with a pure REST api call with python requests. (calling a feature server)

I will say, something IS broken with arcgis python package. Having a package on PyPi that cannot be installed properly is not right... 

0 Kudos
JDR302Dev
New Contributor

Can you please share how you did that???

0 Kudos
JosephRathvon
Occasional Contributor

I am having the same issue. I installed using pip because conda/anaconda keeps messing up my flask site.  I tried to workaround with Requests but only got most of my site working.  Trying to fill in the gaps and installed arcgis.   now I get the same error.

0 Kudos
CParker
New Contributor II

Well good luck buddy, I get the sense they don't want us using just pip for some reason... What functionality are you missing with Requests, if you don't mind me asking?

0 Kudos
JosephRathvon
Occasional Contributor

I need to updatefeatures in an AGOL feature service. I keep getting a bad token response to my POST request. 

0 Kudos
CParker
New Contributor II

Have you reviewed the different Auth methods to do something similar in Requests?

https://developers.arcgis.com/documentation/mapping-apis-and-services/security/#api-keys

0 Kudos
JosephRathvon
Occasional Contributor

Thanks. I'll take a look at that. I need to unbrick my python install first though.

0 Kudos