It's an issue, because Python is in transition between 2.x and 3. The problem is, some distros already ship (or are about to ship Python3 as default) so relying on python to be 2.x is treacherous. So I think switching to python2 was right, because this can be fixed to work in all cases.
Case 1: system with default Python 2.x, no Python3 available
python will be 2.x
make python2 a link to python
Case 2: system with default Python 2.x with Python3 available
python will be 2.x
make python2 a link to python if it doesn't exist already
Case 3: system with default Python 3
python will be 3
python2 will be available if Python 2.x is installed
But relying on python to be Python 2.x will not work (with no workaround) in the 3rd case.
Instructions to fix Python when necessary:
# Install Pythonsudo apt-get install python# Make sure that Python is 2.x (3.x is not supported at the moment)python --version# If it's Python 3 you might need to install Python 2 separatelysudo apt-get install python2.7# Make sure you can access Python via `python2`python2 --version# If you get a "command not found" error create a link to the python binarysudo ln-s /usr/bin/python /usr/bin/python2
By Administrator on 2012-12-07T16:51:02 (imported from GitLab project)
By Administrator on 2012-12-07T16:51:02 (imported from GitLab)
Also most dev machines run more recent distros than what production servers have. So even if you are clear in production you'll have a headache when developing. :P
By Administrator on 2012-12-07T17:12:39 (imported from GitLab project)
By Administrator on 2012-12-07T17:12:39 (imported from GitLab)
Creating the python2link is an easy and uncritical fix.
Replacing python on a system where other system components assume it's Python 3 might not be an option at all.
By Administrator on 2012-12-07T17:44:11 (imported from GitLab project)
By Administrator on 2012-12-07T17:44:11 (imported from GitLab)
@Riyad adding to troubleshoot guide is not enouhg. We got hundreds of issues after release cause of this. So we should at least add it to installation and migration docs.
By Administrator on 2012-12-07T20:36:57 (imported from GitLab project)
By Administrator on 2012-12-07T20:36:57 (imported from GitLab)
Yes of course. I'm working on an update to the gitlab:app:status task that will check on many things that are in the trouble shooting guide or things that say "make sure" in the installation manual.
By Administrator on 2012-12-07T21:11:55 (imported from GitLab project)
By Administrator on 2012-12-07T21:11:55 (imported from GitLab)
Do you know a workaround for crappy distros like Centos5.5? Centos needs python 2.4 for yum - but gitlab needs a newer python version. I tried it using virtualenv but I can't get it to work properly... (The virtualenv is configured for the gitlab user)
Symlinking python 2.7.3 (the one I'm using) to python2 in /usr/bin didn't do the trick...
By Administrator on 2012-12-11T13:46:32 (imported from GitLab project)
By Administrator on 2012-12-11T13:46:32 (imported from GitLab)
Have you tried and made sure 2.4 indeed doesn't work, because I just read in the Pygments Docs:
Pygments requires at least Python 2.4 to work correctly. Just to clarify: there won't ever be support for Python versions below 2.4. However, there are no other dependencies.
Question (although I'm unsure this is the correct thread): - Why is pygments still using my /usr/bin/python binary DESPITE a configured virtual python evironment with python 2.7 running?
Here a process grep showing the git user using /usr/bin/python (that's the 2.4.3 version) for pygments:
Update: The only work-around working for me at the moment is directly updating the vendor file mentos.py
and changing the env line #!/usr/bin/env python to the fixed binary path #!/usr/bin/python2.7 - But that can't be the permanent solution.
I suspect the gitlab user doesn't load its .basrc file before starting the mentos.py background process....
By Administrator on 2012-12-17T13:34:25 (imported from GitLab project)
By Administrator on 2012-12-17T13:34:25 (imported from GitLab)
Hi everybody
I setup gitlab with version 4.0.0
I have a problem with python2 when I use command "sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production"
Error : Has python2? ... yes
python2 is supported version? ... no
Try fixing it:
Make sure you have Python 2.5+ installed
Link it to python2
For more information see:
doc/install/installation.md in section "Packages / Dependencies"
Please fix the error above and rerun the checks.
Although, I did excute command : sudo ln -s /usr/bin/python /usr/bin/python2
python -V : Python 2.7
python2 -V : Python 2.7
I complie python from source.
I'm sorry my english is poor !
Thanks people !
By Administrator on 2012-12-28T04:13:00 (imported from GitLab project)
By Administrator on 2012-12-28T04:13:00 (imported from GitLab)