How to setup Python 2.7 and Virtualenv on a shared host with no root access?

1,111 views
Skip to first unread message

Dan Santos

unread,
May 12, 2012, 10:29:39 AM5/12/12
to django...@googlegroups.com
1.)
Hi I have downloaded this zip file:  Python-2.7.3.tgz

2.)
And tried to compile it, I think it's called by doing this command:

dan@debian:~/usr-32/Python-2.7.3$ ./configure --prefix=/home/dan/usr-32

checking for --enable-universalsdk... no
checking for --with-universal-archs... 32-bit
checking MACHDEP... linux2
checking EXTRAPLATDIR... 
checking machine type as reported by uname -m... x86_64
checking for --without-gcc... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home/dan/usr-32/Python-2.7.3':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

How do I deal with this on my shared host account with no root access?

Alec Taylor

unread,
May 12, 2012, 10:45:09 AM5/12/12
to django...@googlegroups.com
Without gcc you can't do anything yourself.

Extract the binary out of the Python package for your platform

Alternatively I think this has a Python interpreter: http://portablelinuxapps.org/development/wireshark

Might be only 2.6 though...


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/i_yNbeu7jQgJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Dan Santos

unread,
May 12, 2012, 11:14:23 AM5/12/12
to django...@googlegroups.com
Thanks for the tips they will come in handy in the future! :)

It seems like my web host did a kernel update or something and then gcc disappeared because it worked before.  But they have fixed that problem now.  So here's my real problem.


dan@debian:~$ cat .bash_aliases 
alias py27='/home/dan/usr-32/Python-2.7.3/./python'


dan@debian:~/usr-32$ py27 virtualenv.py ~/.virtualenvs/ENV2
Traceback (most recent call last):
  File "virtualenv.py", line 17, in <module>
    import zlib
ImportError: No module named zlib


How do I import zlib?
I tried this yesterday but it didn't work.
dan@debian:~/usr-32/Python-2.7.3$ ./configure --prefix=/home/dan/usr-32 --with-zlib
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.

Alec Taylor

unread,
May 12, 2012, 2:19:15 PM5/12/12
to django...@googlegroups.com
You'll need the relevant C library

(zlib)

Or there is certainly a deb or rpm for it

To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/STsg9RKgrt8J.

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.

darwin31

unread,
May 24, 2012, 11:31:39 PM5/24/12
to django...@googlegroups.com
Hi, Dan

Yes you can do it. First of all you will need to install a new version of Python in a folder that do not require admin permissions to write files. 
1) Follow this tutorial to accomplish this first step (New python install on a shared host)
2) Change your PATH variable on ~/.bash_profile. Basically, all you have to do is to insert the new path to the Python version you just installed BEFORE the path that is pointing to the root (where you have no permissions ex: $HOME/bin). My PATH is like that: PATH=$PATH:$HOME:python/bin:$HOME/bin:
3) Install easy_install using setuptools
4) Install Pip using easy_install (easy_install pip)

After that you will be able to install whatever you want (virtualenv, django etc) on your shared host. I hope it helps!

darwin31

unread,
May 25, 2012, 4:58:19 PM5/25/12
to django...@googlegroups.com
I forgot to say something important. In order to make such changes permanent you will need to insert in the END of you ~/.bash_profile the following commands:

export WORKON_HOME=~/Envs
source ~/python/bin/virtualenvwrapper.sh


Em sábado, 12 de maio de 2012 07h29min39s UTC-3, Dan Santos escreveu:

Dan Santos

unread,
Jun 15, 2012, 8:18:05 PM6/15/12
to django...@googlegroups.com
Hi darwin,

Sorry for the late reply. Thanks for your new instructions. I'm
currently stuck at step 1 because my wehost hasn't included important
commands and packages such as:

* uname
* make
* gcc (package)

So I will try to discuss with my webhost this week to see if they can
enable those commands so I can compile my chosen Python version.
And then continue with running your procedure.


//Dan



On 5/25/12, darwin31 <luiz...@gmail.com> wrote:
> I forgot to say something important. In order to make such changes
> permanent you will need to insert in the END of you ~/.bash_profile the
> following commands:
>
> export WORKON_HOME=~/Envs
> source ~/python/bin/virtualenvwrapper.sh
>
>
> Em sábado, 12 de maio de 2012 07h29min39s UTC-3, Dan Santos escreveu:
>>
>> *1.)*
>> Hi I have downloaded this zip file: Python-2.7.3.tgz
>>
>> *2.)*
>> And tried to compile it, I think it's called by doing this command:
>>
>> dan@debian:~/usr-32/Python-2.7.3$ *./configure --prefix=/home/dan/usr-32*
>> *
>> *
>> checking for --enable-universalsdk... no
>> checking for --with-universal-archs... 32-bit
>> checking MACHDEP... linux2
>> checking EXTRAPLATDIR...
>> checking machine type as reported by uname -m... x86_64
>> checking for --without-gcc... no
>> checking for gcc... no
>> checking for cc... no
>> checking for cl.exe... no
>> configure: error: in `/home/dan/usr-32/Python-2.7.3':
>> configure: error: no acceptable C compiler found in $PATH
>> See `config.log' for more details
>>
>>
>> How do I deal with this on my shared host account with no root access?
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/85q_uB8_rWQJ.

Kurtis Mullins

unread,
Jun 15, 2012, 8:53:37 PM6/15/12
to django...@googlegroups.com
Honestly, if your host doesn't provide those services out of the box -- you might have better luck going with a different hosting provider. I would choose a cheap VPS or Cloud Server if I were you.
Reply all
Reply to author
Forward
0 new messages