You are not logged in or registered. Please login or register to use the full functionality of this board...

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Error issue Fix
#1
We have received lot of reports of bellow Python error,

Quote:root@server [/usr/local/src/publicnginx]# ./nginxinstaller install
/usr/local/src/publicnginx
Welcome to the Nginx Admin installer......Starting Install
Generating vhosts...
Traceback (most recent call last):
File "/scripts/createvhosts.py", line 2, in ?
import yaml
File "/usr/lib/python2.4/site-packages/PyYAML-3.10-py2.4-linux-i686.egg/yaml/__init__.py", line 26
SyntaxError: 'yield' not allowed in a 'try' block with a 'finally' clause
Installing WHM interface...
deploying booster rockets
Traceback (most recent call last):
File "/usr/local/src/publicnginx/nginxinstaller2", line 9, in ?
import createvhosts
File "/usr/local/src/publicnginx/createvhosts.py", line 2, in ?
import yaml
File "/usr/lib/python2.4/site-packages/PyYAML-3.10-py2.4-linux-i686.egg/yaml/__init__.py", line 26
SyntaxError: 'yield' not allowed in a 'try' block with a 'finally' clause

The working fix is found here http://nginxcp.com/forums/Thread-installation-error
But to to high demand we have added a fix of this issue in Nginx Admin 2.9 and all later versions



If you are receiving this error bellow is the fix,
Code:
cd /usr/local/src
wget http://nginxcp.com/latest/nginxadmin.tar
tar xf nginxadmin.tar
cd publicnginx
./pythonfix
After that you can run installer as per bellow,
./nginxinstaller install



This error normally happen if you install first time, You have not needed this fix is you are upgrading from old version.
NOTE: Please don't run this fix multiple time
Administrator
NginxCP.com - cPanel Nginx automated installer Plugin
Reply
#2
Some users could run into issues after updating the python version on their system. I try to be careful with these things, as I never know what could go wrong... which reminds me of: forums.cpanel.net/f5/python-python-2-7-1-installation-187531.html

Anyway, for those few lost souls out there who need a quick solution for installing nginxcp (without updating your current python version) I would recommend the following 3 steps:

PS: This fix should also work if you still get errors after running the "pythonfix"

1.) First we install a newer version of python (making sure it installs as *alternate*). I recommend you try at least with python2.7 (which worked great for me)
For this step we run these commands:
Code:
cd /usr/local/src/
wget http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz
tar xf Python-2.7.2.tgz
cd Python-2.7.2
./configure && make && make altinstall

2.) Now we search and replace the string "python" in the nginxcp installer script(s) to "python2.7"
For this step we run the following commands:
Code:
cd /usr/local/src
wget http://nginxcp.com/latest/nginxadmin.tar
tar xf nginxadmin.tar
cd publicnginx
find . -name "*" -type f -print | xargs sed -i 's/env python/env python2\.7/g'
find . -name "*" -type f -print | xargs sed -i 's/(\"python /(\"python2\.7 /g'

3.) Step #2 should not give you any errors or messages, so we can attempt to install with the commands you already know:
Code:
cd /usr/local/src/publicnginx/
./nginxinstaller install


I did this more than a year ago and tried it today... still works like a charm Smile
Reply
#3
How to remove and uninstall python that has been installed using ./configure && make && make altinstall?

And if I uninstalled this version I will uninstall the system python version? I already checked and found I have python 2.6.6 installed? although I installed 2.7.2 as per your post!!

Any idea how to revert this installation process because I experience an increase in server memory usage!

Thank in advance.

(08-16-2013, 10:26 PM)charley Wrote: Some users could run into issues after updating the python version on their system. I try to be careful with these things, as I never know what could go wrong... which reminds me of: forums.cpanel.net/f5/python-python-2-7-1-installation-187531.html

Anyway, for those few lost souls out there who need a quick solution for installing nginxcp (without updating your current python version) I would recommend the following 3 steps:

PS: This fix should also work if you still get errors after running the "pythonfix"

1.) First we install a newer version of python (making sure it installs as *alternate*). I recommend you try at least with python2.7 (which worked great for me)
For this step we run these commands:
Code:
cd /usr/local/src/
wget http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz
tar xf Python-2.7.2.tgz
cd Python-2.7.2
./configure && make && make altinstall

2.) Now we search and replace the string "python" in the nginxcp installer script(s) to "python2.7"
For this step we run the following commands:
Code:
cd /usr/local/src
wget http://nginxcp.com/latest/nginxadmin.tar
tar xf nginxadmin.tar
cd publicnginx
find . -name "*" -type f -print | xargs sed -i 's/env python/env python2\.7/g'
find . -name "*" -type f -print | xargs sed -i 's/(\"python /(\"python2\.7 /g'

3.) Step #2 should not give you any errors or messages, so we can attempt to install with the commands you already know:
Code:
cd /usr/local/src/publicnginx/
./nginxinstaller install


I did this more than a year ago and tried it today... still works like a charm Smile
Reply
#4
Very sorry to hear you are having issues... like I said, everything is running good on my box Confused

What is the output of the following commands?:
Code:
python –version
/usr/bin/python –version

I'm pretty sure the only way to "uninstall" version 2.7.2 is to remove the files manually... but only do so if your system is not returning 2.7.2 as the default python version

Also, make sure that /usr/bin is before /usr/local/bin. You can check that by running:
Code:
echo $PATH



(08-27-2013, 09:50 PM)EgyCode Wrote: How to remove and install python that has been installed using ./configure && make && make altinstall?

And if I uninstalled this version I will uninstall the system python version? I already checked and found I have python 2.6.6 installed? although I installed 2.7.2 as per your post!!

Any idea how to revert this installation process because I experience an increase in server memory usage!

Thank in advance.

(08-16-2013, 10:26 PM)charley Wrote: Some users could run into issues after updating the python version on their system. I try to be careful with these things, as I never know what could go wrong... which reminds me of: forums.cpanel.net/f5/python-python-2-7-1-installation-187531.html

Anyway, for those few lost souls out there who need a quick solution for installing nginxcp (without updating your current python version) I would recommend the following 3 steps:

PS: This fix should also work if you still get errors after running the "pythonfix"

1.) First we install a newer version of python (making sure it installs as *alternate*). I recommend you try at least with python2.7 (which worked great for me)
For this step we run these commands:
Code:
cd /usr/local/src/
wget http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz
tar xf Python-2.7.2.tgz
cd Python-2.7.2
./configure && make && make altinstall

2.) Now we search and replace the string "python" in the nginxcp installer script(s) to "python2.7"
For this step we run the following commands:
Code:
cd /usr/local/src
wget http://nginxcp.com/latest/nginxadmin.tar
tar xf nginxadmin.tar
cd publicnginx
find . -name "*" -type f -print | xargs sed -i 's/env python/env python2\.7/g'
find . -name "*" -type f -print | xargs sed -i 's/(\"python /(\"python2\.7 /g'

3.) Step #2 should not give you any errors or messages, so we can attempt to install with the commands you already know:
Code:
cd /usr/local/src/publicnginx/
./nginxinstaller install


I did this more than a year ago and tried it today... still works like a charm Smile
Reply
#5
Thank you for your reply, I checked for running python version and I found I have python 2.6.6 but I didn't understand what you've mentioned about

Quote:Also, make sure that /usr/bin is before /usr/local/bin. You can check that by running:
Code:
echo $PATH

I've this when I run the above command:

Code:
/usr/local/jdk/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin

I didn't find any file or directory with this name "jdk" or "X11R6"

Would you explain the above command and result please?

And also how to manually delete the installation files? how could I know or find the installation directory and all installation files?

Thank in advance.

(08-27-2013, 11:58 PM)charley Wrote: Very sorry to hear you are having issues... like I said, everything is running good on my box Confused

What is the output of the following commands?:
Code:
python –version
/usr/bin/python –version

I'm pretty sure the only way to "uninstall" version 2.7.2 is to remove the files manually... but only do so if your system is not returning 2.7.2 as the default python version

Also, make sure that /usr/bin is before /usr/local/bin. You can check that by running:
Code:
echo $PATH



(08-27-2013, 09:50 PM)EgyCode Wrote: How to remove and install python that has been installed using ./configure && make && make altinstall?

And if I uninstalled this version I will uninstall the system python version? I already checked and found I have python 2.6.6 installed? although I installed 2.7.2 as per your post!!

Any idea how to revert this installation process because I experience an increase in server memory usage!

Thank in advance.

(08-16-2013, 10:26 PM)charley Wrote: Some users could run into issues after updating the python version on their system. I try to be careful with these things, as I never know what could go wrong... which reminds me of: forums.cpanel.net/f5/python-python-2-7-1-installation-187531.html

Anyway, for those few lost souls out there who need a quick solution for installing nginxcp (without updating your current python version) I would recommend the following 3 steps:

PS: This fix should also work if you still get errors after running the "pythonfix"

1.) First we install a newer version of python (making sure it installs as *alternate*). I recommend you try at least with python2.7 (which worked great for me)
For this step we run these commands:
Code:
cd /usr/local/src/
wget http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz
tar xf Python-2.7.2.tgz
cd Python-2.7.2
./configure && make && make altinstall

2.) Now we search and replace the string "python" in the nginxcp installer script(s) to "python2.7"
For this step we run the following commands:
Code:
cd /usr/local/src
wget http://nginxcp.com/latest/nginxadmin.tar
tar xf nginxadmin.tar
cd publicnginx
find . -name "*" -type f -print | xargs sed -i 's/env python/env python2\.7/g'
find . -name "*" -type f -print | xargs sed -i 's/(\"python /(\"python2\.7 /g'

3.) Step #2 should not give you any errors or messages, so we can attempt to install with the commands you already know:
Code:
cd /usr/local/src/publicnginx/
./nginxinstaller install


I did this more than a year ago and tried it today... still works like a charm Smile
Reply
#6
What is the output of the following command?
Code:
whereis python

Also, the result of "echo $PATH" is correct in your system... I don't see any problem there.

-Charley



(08-28-2013, 12:40 PM)EgyCode Wrote: Thank you for your reply, I checked for running python version and I found I have python 2.6.6 but I didn't understand what you've mentioned about

Quote:Also, make sure that /usr/bin is before /usr/local/bin. You can check that by running:
Code:
echo $PATH

I've this when I run the above command:

Code:
/usr/local/jdk/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin

I didn't find any file or directory with this name "jdk" or "X11R6"

Would you explain the above command and result please?

And also how to manually delete the installation files? how could I know or find the installation directory and all installation files?

Thank in advance.

(08-27-2013, 11:58 PM)charley Wrote: Very sorry to hear you are having issues... like I said, everything is running good on my box Confused

What is the output of the following commands?:
Code:
python –version
/usr/bin/python –version

I'm pretty sure the only way to "uninstall" version 2.7.2 is to remove the files manually... but only do so if your system is not returning 2.7.2 as the default python version

Also, make sure that /usr/bin is before /usr/local/bin. You can check that by running:
Code:
echo $PATH



(08-27-2013, 09:50 PM)EgyCode Wrote: How to remove and install python that has been installed using ./configure && make && make altinstall?

And if I uninstalled this version I will uninstall the system python version? I already checked and found I have python 2.6.6 installed? although I installed 2.7.2 as per your post!!

Any idea how to revert this installation process because I experience an increase in server memory usage!

Thank in advance.

(08-16-2013, 10:26 PM)charley Wrote: Some users could run into issues after updating the python version on their system. I try to be careful with these things, as I never know what could go wrong... which reminds me of: forums.cpanel.net/f5/python-python-2-7-1-installation-187531.html

Anyway, for those few lost souls out there who need a quick solution for installing nginxcp (without updating your current python version) I would recommend the following 3 steps:

PS: This fix should also work if you still get errors after running the "pythonfix"

1.) First we install a newer version of python (making sure it installs as *alternate*). I recommend you try at least with python2.7 (which worked great for me)
For this step we run these commands:
Code:
cd /usr/local/src/
wget http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz
tar xf Python-2.7.2.tgz
cd Python-2.7.2
./configure && make && make altinstall

2.) Now we search and replace the string "python" in the nginxcp installer script(s) to "python2.7"
For this step we run the following commands:
Code:
cd /usr/local/src
wget http://nginxcp.com/latest/nginxadmin.tar
tar xf nginxadmin.tar
cd publicnginx
find . -name "*" -type f -print | xargs sed -i 's/env python/env python2\.7/g'
find . -name "*" -type f -print | xargs sed -i 's/(\"python /(\"python2\.7 /g'

3.) Step #2 should not give you any errors or messages, so we can attempt to install with the commands you already know:
Code:
cd /usr/local/src/publicnginx/
./nginxinstaller install


I did this more than a year ago and tried it today... still works like a charm Smile
Reply
#7
Thank you, the output of the command is

python: /usr/bin/python2.6 /usr/bin/python2.6-config /usr/bin/python /usr/lib/python2.6 /usr/local/bin/python2.7-config /usr/local/bin/python2.7 /usr/local/lib/python2.7 /usr/include/python2.6 /usr/share/man/man1/python.1.gz
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)