Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"sys-package-mgr*: can't create package cache dir" when run python script with Jython

Tags:

python

jython

I want to run Python script with Jython.

the result show correctly, but at the same time there is an warning message, "sys-package-mgr*: can't create package cache dir"

How could I solve this problem?

thanks in advance~~~

like image 652
rmn190 Avatar asked Jul 20 '13 03:07

rmn190


2 Answers

You can change the location of the cache directory to a place that you have read & write access to by setting the "python.cachedir" option when starting jython, e.g.:

jython -Dpython.cachedir=*your cachedir directory here*

or:

java -jar my_standalone_jython.jar -Dpython.cachedir=*your cachedir directory here*

You can read about the python.cachedir option here: http://www.jython.org/archive/21/docs/registry.html

like image 59
jcdude Avatar answered Nov 11 '22 17:11

jcdude


1) By changing permissions to allow writing to the directory in the error message.

2) By setting python.cachedir.skip = true

You can read this:

http://www.jython.org/jythonbook/en/1.0/ModulesPackages.html#module-search-path-compilation-and-loading

for further insights.

like image 41
7stud Avatar answered Nov 11 '22 18:11

7stud