Hey Alex,

You can use e.g pip https://pip.pypa.io/en/stable/ but I guess any
Python package manager will do. With pip it would be smth like:

pip install packagename -t /the/path/you/want

Maybe there's a way through simply setting environment variables
aswell to use your existing modules. But not really sure, I don't know
enough about jython/java for that matter.

All the best,
Tõnis


2017-09-05 3:05 GMT+03:00 Alex Chen <[email protected]>:
> Thanks Tõnis!
>
> Here is the output to the sys.path in my script when run by GeoServer:
>
> ['C:\\geoserver_data\\scripts\\lib\\py', 'C:\\Program Files (x86)\\GeoServer
> 2.11.2\\webapps\\geoserver\\WEB-INF\\lib\\Lib', 'C:\\Program Files
> (x86)\\GeoServer
> 2.11.2\\webapps\\geoserver\\WEB-INF\\lib\\jython-2.7.0.jar\\Lib',
> '__classpath__', '__pyclasspath__/']
>
>
> Obviously the "requests" python library is not contained in any of the paths
> above. So the question is how I can install "requests" so that GeoServer can
> use. The official documentation does not offer any clue in this aspect.
>
> Much appreciated!
>
> Cheers,
> Alex
>
>
> On Monday, 4 September 2017, 8:52:03 pm AEST, tõnis kärdi
> <[email protected]> wrote:
>
>
> Sorry, I meant sys.path :)
>
> Tõnis
>
> 2017-09-04 11:22 GMT+03:00 tõnis kärdi <[email protected]>:
>> Hi Alex,
>>
>> did you check what os.sys.path outputs in a script run by GeoServer?
>> Maybe it's just that requests is not on an importable path?
>>
>> All the best,
>> Tõnis
>>
>> 2017-09-04 4:38 GMT+03:00 Alex Chen via Geoserver-users
>> <[email protected]>:
>>> Dear all,
>>>
>>> I am with GeoServer 2.11.2 and am planning to do some scripting on it.
>>>
>>> I would like to run some custom Python scripts either as Apps that can be
>>> called via http or as WPS services. I have managed to install the scripts
>>> plugin on GeoServer, and the "apps" and "wps" folders are both visible in
>>> the "scripts" parent folder.
>>>
>>> I have tried to save some custom scripts in the apps folder and called
>>> via
>>> http, for instance, "http://localhost:8090/geoserver/script/apps/hello";,
>>> but
>>> it failed due to "unable to find packages". Those packages that GeoServer
>>> was unable to find include "requests" and "urllib2" etc but I am pretty
>>> sure
>>> they were both installed properly on the Python. I am wondering how
>>> GeoServer gets to know where the Python (2.7.13) directory is and how
>>> Python
>>> gets utilised by GeoServer on my computer via either http or wps.
>>>
>>> I have posted some questions on stackoverflow, but haven't received much
>>> positive reply.
>>>
>>> Much appreciated!
>>>
>>> Alex
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> Geoserver-users mailing list
>>>
>>> Please make sure you read the following two resources before posting to
>>> this
>>> list:
>>> - Earning your support instead of buying it, but Ian Turton:
>>> http://www.ianturton.com/talks/foss4g.html#/
>>> - The GeoServer user list posting guidelines:
>>> http://geoserver.org/comm/userlist-guidelines.html
>>>
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/geoserver-users



-- 
@tkardi
skype: tonis.kardi

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to