I need to write "trow-away" scripts (or scripts to be used only once) but for UTF-8 files and it seems that Python 3 is much better than Python 2.7 (which comes with my Debian 7 distro) for that purpose so I have followed a "how to" from a Ubuntu forum explaining how to download and install Python-3.3.5 with the following instructions for which I have absolutely no experience:
Code:
wget http://www.python.org/ftp/python/3-3.5/Python-3-3.5.tar.xz
tar xJf ./Python-3-3.5.tar.xz
cd ./Python-3-3.5
./configure --prefix=/opt/python3-3
make && sudo make install
Python-3.3.5 was installed successfully in
Code:
/home/user_x/Python-3.3.5
and
/opt/python3.3/bin
with no problem but after changing the first line of a Python 2.7 script to
Code:
#!/home/user_x/Python-3.3.5
or
#!/opt/python3.3/bin
I get the message:
Code:
bash: ./test.py: /home/user_x/Python-3.3.5: bad interpreter: Permission denied
or
bash: ./test.py: /opt/python3.3/bin: bad interpreter: Permission denied
This is even after "chown" everything owned by root in /home/user_x/Python-3.3.5 and /opt/python3.3/bin to "user_x" and giving directory ~/Python-3.3.5/ permissions 777
Both text.py and the directory Python-3.3.5 (and its files) belong to the same user_x and group user_x. There is 2 larges files as below and subdirectory "Python" contains all the .c .h .o files.
Code:
-rw-r--r-- 1 user_x user_x 17304682 May 17 21:43 libpython3.3m.a
-rwxr-xr-x 1 user_x user_x 10180893 May 17 21:43 python
drwxr-xr-x 2 user_x user_x 4096 May 17 21:43 Python
This is contents of /opt/python3.3/bin:
Code:
lrwxrwxrwx 1 root root 8 May 17 21:45 2to3 -> 2to3-3.3
-rwxr-xr-x 1 user_x user_x 105 May 17 21:45 2to3-3.3
lrwxrwxrwx 1 root root 7 May 17 21:45 idle3 -> idle3.3
-rwxr-xr-x 1 user_x user_x 103 May 17 21:45 idle3.3
lrwxrwxrwx 1 root root 8 May 17 21:45 pydoc3 -> pydoc3.3
-rwxr-xr-x 1 user_x user_x 88 May 17 21:45 pydoc3.3
lrwxrwxrwx 1 root root 9 May 17 21:45 python3 -> python3.3
-rwxr-xr-x 2 user_x user_x 10180893 May 17 21:44 python3.3
lrwxrwxrwx 1 root root 17 May 17 21:45 python3.3-config -> python3.3m-config
-rwxr-xr-x 2 user_x user_x 10180893 May 17 21:44 python3.3m
-rwxr-xr-x 1 user_x user_x 1982 May 17 21:45 python3.3m-config
lrwxrwxrwx 1 root root 16 May 17 21:45 python3-config -> python3.3-config
lrwxrwxrwx 1 root root 10 May 17 21:45 pyvenv -> pyvenv-3.3
-rwxr-xr-x 1 user_x user_x 240 May 17 21:45 pyvenv-3.3
Could anyone tell me what could be wrong?
Thank you for your help.