Re: [venv] Setting Non-default-python-version in virtualenv

2016-09-20 Thread Jakub Vysoky
note> in my usual linux distro (archlinux) i have virtualenv installed
under both py2 and py3, so for creating py2 virtualenv i have an executable
virtualenv2 - convenience of my distro packages.

On Mon, Sep 19, 2016 at 5:39 PM, Paul Moore  wrote:

> You should confirm that the python executable in the venv is actually
> Python 2.7, which you can do by running
>
> ~/env_dir/python -V
> ~/env_dir/python2.7 -V
>
> (both of those files should exist, and you can run the above without
> activating the virtualenv, as you're specifying the exact path).
>
> If either of them shows Python 3 as the version, then your
> installation is not working correctly. It may be that Debian has
> somehow patched things in a way that's causing the issue - you say
> "the default Python is Python 3.4.2" - does Debian make that happen by
> some symlink juggling that might be causing issues here? (I know
> almost nothing about how Linux distros patch upstream tools, but we
> have had issues in the past which have ended up being related to
> patches applied on Debian).
>
> Paul
>
> --
> You received this message because you are subscribed to the Google Groups
> "virtualenv" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to python-virtualenv+unsubscr...@googlegroups.com.
> To post to this group, send email to python-virtualenv@googlegroups.com.
> Visit this group at https://groups.google.com/group/python-virtualenv.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Jakub Vysoky

mob: +420 605 852 377
jab: jakub.vys...@gmail.com
twit: https://twitter.com/kvbik

-- 
You received this message because you are subscribed to the Google Groups 
"virtualenv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python-virtualenv+unsubscr...@googlegroups.com.
To post to this group, send email to python-virtualenv@googlegroups.com.
Visit this group at https://groups.google.com/group/python-virtualenv.
For more options, visit https://groups.google.com/d/optout.


Re: [venv] Setting Non-default-python-version in virtualenv

2016-09-19 Thread Paul Moore
You should confirm that the python executable in the venv is actually
Python 2.7, which you can do by running

~/env_dir/python -V
~/env_dir/python2.7 -V

(both of those files should exist, and you can run the above without
activating the virtualenv, as you're specifying the exact path).

If either of them shows Python 3 as the version, then your
installation is not working correctly. It may be that Debian has
somehow patched things in a way that's causing the issue - you say
"the default Python is Python 3.4.2" - does Debian make that happen by
some symlink juggling that might be causing issues here? (I know
almost nothing about how Linux distros patch upstream tools, but we
have had issues in the past which have ended up being related to
patches applied on Debian).

Paul

-- 
You received this message because you are subscribed to the Google Groups 
"virtualenv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python-virtualenv+unsubscr...@googlegroups.com.
To post to this group, send email to python-virtualenv@googlegroups.com.
Visit this group at https://groups.google.com/group/python-virtualenv.
For more options, visit https://groups.google.com/d/optout.


Re: [venv] Setting Non-default-python-version in virtualenv

2016-09-19 Thread Amir Teymuri

>
> Also take a look on my question at stack overflow:


http://stackoverflow.com/questions/39556999/setting-non-default-python-version-in-virtualenv?noredirect=1#comment66425211_39556999
 

-- 
You received this message because you are subscribed to the Google Groups 
"virtualenv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python-virtualenv+unsubscr...@googlegroups.com.
To post to this group, send email to python-virtualenv@googlegroups.com.
Visit this group at https://groups.google.com/group/python-virtualenv.
For more options, visit https://groups.google.com/d/optout.


Re: [venv] Setting Non-default-python-version in virtualenv

2016-09-18 Thread Amir Teymuri
Yes i have a python 2.7 installed on my machin.
On Sep 18, 2016 2:03 PM, "Amir Teymuri"  wrote:

> My default python version on my Debian 8.5 machine is *3.4.2*. I want to
> use python *2.7* for only one project. I have tried running all of the
> following commands in the terminal one by one, :
>
> virtualenv -p python2.7 env_dir
> virtualenv -p python2 env_dir
> virtualenv --python=python2.7 env_dir
>
> And this is the file.py inside the env_dir:
>
> print "Hello world from inside env_dir"
>
> Obviously however the file.py still gets executed with python3.4.2,
> because i run:
>
> python file.py
>
> and i get:
>
>   File "file.py", line 1
> print "Hello world from inside env_dir"
>   ^SyntaxError: Missing parentheses in 
> call to 'print'
>
> What is the problem, why it fails to run the code in python2.7?
>
> *Update*
>
> I have also tried:
>
> virtualenv -p /usr/bin/python2.7 env_dir
>
> source env_dir/bin/activate
>
> (env_dir) amir@amir-debian:~/env_dir$ python file.py
>   File "file.py", line 1
> print "Insid virtual env"
> ^SyntaxError: Missing parentheses in call to 'print'
>
> Running python -V after activating returns: *Python 3.4.2*
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "virtualenv" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/python-virtualenv/pQMSeVDZRiw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> python-virtualenv+unsubscr...@googlegroups.com.
> To post to this group, send email to python-virtualenv@googlegroups.com.
> Visit this group at https://groups.google.com/group/python-virtualenv.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"virtualenv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python-virtualenv+unsubscr...@googlegroups.com.
To post to this group, send email to python-virtualenv@googlegroups.com.
Visit this group at https://groups.google.com/group/python-virtualenv.
For more options, visit https://groups.google.com/d/optout.


Re: [venv] Setting Non-default-python-version in virtualenv

2016-09-18 Thread Tres Seaver
On 09/18/2016 08:03 AM, Amir Teymuri wrote:
> 
> 
> My default python version on my Debian 8.5 machine is *3.4.2*. I want to 
> use python *2.7* for only one project. I have tried running all of the 
> following commands in the terminal one by one, :
> 
> virtualenv -p python2.7 env_dir
> virtualenv -p python2 env_dir
> virtualenv --python=python2.7 env_dir
> 
> And this is the file.py inside the env_dir:
> 
> print "Hello world from inside env_dir"
> 
> Obviously however the file.py still gets executed with python3.4.2, because 
> i run:
> 
> python file.py
> 
> and i get:
> 
>   File "file.py", line 1
> print "Hello world from inside env_dir"
>   ^SyntaxError: Missing parentheses in 
> call to 'print'
> 
> What is the problem, why it fails to run the code in python2.7?

I can't reproduce here:

--- %< -
$ /opt/Python-3.4.3/bin/virtualenv -p python2.7 /tmp/foobar
Running virtualenv with interpreter /home/tseaver/bin/python2.7
New python executable in /tmp/foobar/bin/python2.7
Also creating executable in /tmp/foobar/bin/python
Installing setuptools, pip.../done.
$ /tmp/foobar/bin/python
Python 2.7.11 (default, Feb 22 2016, 07:44:44)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
--- %< -

Do you have a version of `python2.7` available on the machine?


Tres.
-- 
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com

-- 
You received this message because you are subscribed to the Google Groups 
"virtualenv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python-virtualenv+unsubscr...@googlegroups.com.
To post to this group, send email to python-virtualenv@googlegroups.com.
Visit this group at https://groups.google.com/group/python-virtualenv.
For more options, visit https://groups.google.com/d/optout.


[venv] Setting Non-default-python-version in virtualenv

2016-09-18 Thread Amir Teymuri


My default python version on my Debian 8.5 machine is *3.4.2*. I want to 
use python *2.7* for only one project. I have tried running all of the 
following commands in the terminal one by one, :

virtualenv -p python2.7 env_dir
virtualenv -p python2 env_dir
virtualenv --python=python2.7 env_dir

And this is the file.py inside the env_dir:

print "Hello world from inside env_dir"

Obviously however the file.py still gets executed with python3.4.2, because 
i run:

python file.py

and i get:

  File "file.py", line 1
print "Hello world from inside env_dir"
  ^SyntaxError: Missing parentheses in call 
to 'print'

What is the problem, why it fails to run the code in python2.7?

*Update*

I have also tried:

virtualenv -p /usr/bin/python2.7 env_dir

source env_dir/bin/activate

(env_dir) amir@amir-debian:~/env_dir$ python file.py 
  File "file.py", line 1
print "Insid virtual env"
^SyntaxError: Missing parentheses in call to 'print'

Running python -V after activating returns: *Python 3.4.2*

-- 
You received this message because you are subscribed to the Google Groups 
"virtualenv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python-virtualenv+unsubscr...@googlegroups.com.
To post to this group, send email to python-virtualenv@googlegroups.com.
Visit this group at https://groups.google.com/group/python-virtualenv.
For more options, visit https://groups.google.com/d/optout.