Installing python 2.7.11 on shared hosting gives permission denied - python

I am following this guideline to install python 2.7.11 on a CentOs shared hosting (bluehost).
I get the following error during the make install phase:
(cd /home2/some_user/python/bin; ln -s python2 python)
ln: creating symbolic link `python': Permission denied
make: *** [bininstall] Error 1
Anywhere in the guideline mentioned 2.7.2 I changed it to 2.7.11.
A few hours back I had installed 2.7.2 with no issues. I get this error when installing 2.7.11.
How can I skip this error and continue with installation of 2.7.11?
Or if there are better ways to install python 2.7.11 on shared hosting it's ok to change method.

Doing this trick solved the issue:
cd /home2/some_user/python/bin;
cp python2.7 python2
So basically I got the error when running make install, ran above commands to trick the installation there is a python2 folder exists, and then reran the make install and python was installed successfully.
Most likely in previous installations python2 was just "python2", not python2.7.
Also here is a better document discussing how to install python 2.7, and for installing 2.7.11 just change all 2.7.2 to 2.7.11. But still running this will give the above error and should do the trick to bypass the error.

Related

How can I fix my python installation?

For some work I'm doing at my office I needed to downgrade my python version from 2.7.9 (OS X default installation) to 2.7.6. It seemed the easiest way to do this would be to uninstall python and then reinstall the older version. After following the instructions here and then running the official Python 2.7.6 installer. I then tried to just run python in the terminal to make sure the installation worked and received this error:
-bash: /usr/local/Cellar/python/2.7.9/bin/python: No such file or directory
Running python --version gave the same results. which python yielded the following directory:
/usr/local/bin/python
Does anyone have any idea how I can fix this issue to get the right version of Python running? I'm pretty much out of ideas at this point.
The symlink in/usr/local/bin/Python is still pointing to the other version. Update it to point to the version currently installed and it should work.

pyenv and installing certain Python packages

I'm trying to install an older version of Python on my Mac. I'm currently running 2.7.9, but our production environment is running 2.7.6. (There is a compatibility issue with gevent and 2.7.9.)
I found pyenv which allows me to install various versions. I've installed pyenv with brew and installed 2.7.6. I then created a virtualenv with 2.7.6 with the following command:
mkvirtualenv my_env --python=/Users/dustin/.pyenv/versions/2.7.6/bin/python
It seems to work fine and I'm running Python 2.7.6. The problem I am running into is that I can't install certain packages with pip such as Cython or M2crypto. I get C compile errors.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
If I create a virtualenv without specifying the Python version, these packages install fine. How do I fix this?
It could be due to trying to run an older version of Python 2.7.x (like 2.7.6) on newer releases of OS X. If you are on OS X 10.10, that's very likely the problem. See http://bugs.python.org/issue21811. You may need to add at least the patch for _osx_support.py. If not, try running pip with -v and update your question with the results.
Update: With the additional information you supplied, it is clear that you are running into the OS X 10.10 support issues that were fixed in the changes for Issue21811 released in 2.7.8. In particular, the configure changes are needed to correctly parse the two-digit minor version number (10); otherwise, the code in configure mistakenly thinks you are are running on a very old version of OS X and generates obsolete link directives. You should backport https://hg.python.org/cpython/rev/2672e30d9095 and https://hg.python.org/cpython/rev/a7ab09e00dbc.

Installing Pyqt4 with brew

Im working with brew to install PyQt on python3 but I cant seem to get it to work
I ran brew install pyqt and brew doctor to fix all possible errors but still when running my code I keep getting
ImportError: No module named 'PyQt4'
If I run echo $PATH im getting /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin
Can someone please guide me on fixing this problem? I am also using PyCharm but I still get the same error if I run in terminal python3 then import pyqt
please help me :( im really new in this but I tried everything that I could find in google
thanks!
PD: Running brew test pyqt does not bring an error but it does not open. Also I installed python3 with brew and im currently running it from /usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/bin/python3.4
If you want to use PyQt4 with Python 3, you should use this command to tell homebrew:
brew install PyQt --with-python3
I had the exact same problem. Installing using the instructions of Longhanks did not work as it said it was already installed.
I got it working with
brew reinstall PyQt --with-python3
The following method is for python 2.7. You can replace the 2.7 into your current python version like 3.4 (enter the directory to see which to use).
Because by default the python package is installed in /usr/local/lib/python2.7/site-packages which is not included in python library
try:
mkdir -p /Users/zgf/Library/Python/2.7/lib/python/site-packages
echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/zgf/Library/Python/2.7/lib/python/site-packages/homebrew.pth
where zgf should be replaced by your username in OSX.
You can also copy the relevant files from /usr/local/lib/python2.7/site-packages into your personal python site package directory or public site package directory (/Library/Python/2.7/site-packages) if you can root.

How do you solve this VirtualEnv Running on Jython Error?

I am able to successfully run virtualenv on python, not but on jython (version 2.5.2). What could be the problem and how do I fix this?
Below is the error:
Susans-MacBook-Pro:Intro_Jython susantan$ virtualenv -p jython susan_env_jy
Running virtualenv with interpreter /Users/susantan/jython2.5.2/bin/jython
ERROR: None
ERROR: this script requires Python 2.6 or greater.
Susans-MacBook-Pro:Intro_Jython susantan$ virtualenv -p python susan_env_jy
Running virtualenv with interpreter /usr/bin/python
New python executable in susan_env_jy/bin/python
Installing setuptools, pip...done.
From the Jython website:
The most current stable release of Jython is 2.5.3. For production purposes, please use this version.
From your error message:
ERROR: this script requires Python 2.6 or greater.
This is probably the cause of the problem. Jython has a 2.7beta1 which you could try.
Edit: from the virtualenv website, it looks like they dropped support for Python 2.5 in v1.10:
1.10 (2013-07-23) ~~~~~~~~~~~~~~~~~
BACKWARDS INCOMPATIBLE Dropped support for Python 2.5. The minimum
You will have to install an earlier version of virtualenv to support Jython 2.5.x
Here is a link to the previous version (1.9.1) https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.9.1.tar.gz - You should be able to install this by extracting the package and running jython setup.py install from within the folder.

mod_wsgi 2.5 on Ubuntu 9.04 with Python 2.6.2 installation

Has anybody succeeded with mod_wsgi 2.5 on Ubuntu 9.04 with default Python installation (2.6.2)?
I got compilation errors:
mod_wsgi.c:119:2: error: #error Sorry, mod_wsgi requires at least Python 2.3.0.
mod_wsgi.c:123:2: error: #error Sorry, mod_wsgi requires that Python supporting thread.
which Python gives /usr/bin/python and /usr/bin/python -V returns Python 2.6.2 so I'm not sure what's wrong with the 1st one, and honestly I don't know how to check options used in compiling default Python on Ubuntu.
There are a lot of other errors but those 2 looks most relevant.
What else could be possibly wrong??
From your errors I see that you're having to compile python extensions. If you haven't already, I suggest you install the python-dev package because it's usually required for compiling python extensions and it's not part of the default installation.
Installing the package is as easy as running:
sudo apt-get install python-dev
from a command line.
Perhaps the user that the server is running as does not have /usr/bin on its path, and there is another version of python somewhere else on the path that is < 2.3
Try:
which -a python
to find all of the pythons on your path. Perhaps one of these is what the server is running.

Categories

Resources