sudo jython ez_setup.py

Thufir Hawat hawat.thufir at gmail.com
Mon Jan 16 20:53:21 UTC 2017


Going by the jython book:

http://www.jython.org/jythonbook/en/1.0/appendixA.html


I downloaded their script, ez_setup.py and ran it as so:




thufir at doge:~/jython$
thufir at doge:~/jython$ jython ez_setup.py
"my" variable $jythonHome masks earlier declaration in same scope at 
/usr/bin/jython line 15.
Downloading 
http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c11-py2.5.egg
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

     [Errno 13] Permission denied: 
'/usr/Lib/site-packages/test-easy-install-1965022501.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

     /usr/Lib/site-packages/

This directory does not currently exist.  Please create it and try again, 
or
choose a different installation directory (using the -d or --install-dir
option).

thufir at doge:~/jython$
thufir at doge:~/jython$ mkdir usr/Lib/site-packages/
mkdir: cannot create directory ‘usr/Lib/site-packages/’: No such file or 
directory
thufir at doge:~/jython$
thufir at doge:~/jython$ sudo usr/Lib/site-packages/
[sudo] password for thufir:
sudo: usr/Lib/site-packages/: command not found
thufir at doge:~/jython$
thufir at doge:~/jython$
thufir at doge:~/jython$ sudo mkdir usr/Lib/site-packages/
mkdir: cannot create directory ‘usr/Lib/site-packages/’: No such file or 
directory
thufir at doge:~/jython$
thufir at doge:~/jython$
thufir at doge:~/jython$ mkdir /usr/Lib/site-packages/
mkdir: cannot create directory ‘/usr/Lib/site-packages/’: No such file or 
directory
thufir at doge:~/jython$
thufir at doge:~/jython$
thufir at doge:~/jython$ sudo mkdir /usr/Lib/site-packages/
mkdir: cannot create directory ‘/usr/Lib/site-packages/’: No such file or 
directory
thufir at doge:~/jython$
thufir at doge:~/jython$
thufir at doge:~/jython$ ll /usr/
total 128
drwxr-xr-x  11 root root  4096 Apr 20  2016 ./
drwxr-xr-x  24 root root  4096 Dec 11 05:44 ../
drwxr-xr-x   2 root root 61440 Jan 16 07:05 bin/
drwxr-xr-x   2 root root  4096 Apr 20  2016 games/
drwxr-xr-x  57 root root  4096 Jan 15 07:34 include/
drwxr-xr-x 173 root root 12288 Jan 15 11:45 lib/
drwxr-xr-x  10 root root  4096 Apr 20  2016 local/
drwxr-xr-x   3 root root  4096 Apr 20  2016 locale/
drwxr-xr-x   2 root root 12288 Jan 15 08:17 sbin/
drwxr-xr-x 337 root root 12288 Jan 16 07:05 share/
drwxr-xr-x   4 root root  4096 Apr 20  2016 src/
thufir at doge:~/jython$
thufir at doge:~/jython$ mkdir /usr/Lib/
mkdir: cannot create directory ‘/usr/Lib/’: Permission denied
thufir at doge:~/jython$
thufir at doge:~/jython$ sudo mkdir /usr/Lib/
thufir at doge:~/jython$ sudo mkdir /usr/Lib/site-packages/
thufir at doge:~/jython$
thufir at doge:~/jython$
thufir at doge:~/jython$ jython ez_setup.py
"my" variable $jythonHome masks earlier declaration in same scope at 
/usr/bin/jython line 15.
Downloading 
http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c11-py2.5.egg
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

     [Errno 13] Permission denied: 
'/usr/Lib/site-packages/test-easy-install-899999428.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

     /usr/Lib/site-packages/

Perhaps your account does not have write access to this directory?  If the
installation directory is a system-owned directory, you may need to sign 
in
as the administrator or "root" account.  If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.

For information on other options, you may wish to consult the
documentation at:

   http://peak.telecommunity.com/EasyInstall.html

Please make the appropriate changes for your system and try again.

thufir at doge:~/jython$






This isn't available through apt?  The only solution seems to be run this 
script with sudo, which I'm reasonably comfortable with.  The 
probabilities seem remote that their would be an actual problem.  Still, 
surely there must be alternatives?

The point of this is to be able to, for example, run python-twitter from 
within jython.



thanks,

Thufir


More information about the ubuntu-users mailing list