How can i use isolated environments in Geany? Thinking that maybe I should create this as a build command so when it compiles it executes using only virtualenv packages.
Any tips on how to get this to happen?
Sayth
On 1 February 2014 10:14, Sayth Renshaw flebber.crue@gmail.com wrote:
How can i use isolated environments in Geany? Thinking that maybe I should create this as a build command so when it compiles it executes using only virtualenv packages.
Any tips on how to get this to happen?
If you know how to do this on the command line, do the same with the Geany build commands build->set build commands.
If you don't know how to do it on the command line, probably best to ask on the Python list.
Cheers Lex
Sayth
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Am 01.02.2014 00:27, schrieb Lex Trotman:
On 1 February 2014 10:14, Sayth Renshaw <flebber.crue@gmail.com mailto:flebber.crue@gmail.com> wrote:
How can i use isolated environments in Geany? Thinking that maybe I should create this as a build command so when it compiles it executes using only virtualenv packages. Any tips on how to get this to happen?
If you know how to do this on the command line, do the same with the Geany build commands build->set build commands.
If you don't know how to do it on the command line, probably best to ask on the Python list.
With virtualenv you are setting a complete environment incl. changing some PATH-variables etc. This can only be done very hard with build commands.
Cheers, Frank
On 14-01-31 03:14 PM, Sayth Renshaw wrote:
How can i use isolated environments in Geany? Thinking that maybe I should create this as a build command so when it compiles it executes using only virtualenv packages.
Any tips on how to get this to happen?
Probably just starting Geany after sourcing the activation script would work OK.
Cheers, Matthew Brush
On 14-01-31 03:28 PM, Matthew Brush wrote:
On 14-01-31 03:14 PM, Sayth Renshaw wrote:
How can i use isolated environments in Geany? Thinking that maybe I should create this as a build command so when it compiles it executes using only virtualenv packages.
Any tips on how to get this to happen?
Probably just starting Geany after sourcing the activation script would work OK.
That is to say, starting Geany from "inside" the virtual env, so it inherits the environment stuff, not just from your normal desktop menus.
Cheers, Matthew Brush
On 1 February 2014 10:28, Matthew Brush mbrush@codebrainz.ca wrote:
On 14-01-31 03:14 PM, Sayth Renshaw wrote:
How can i use isolated environments in Geany? Thinking that maybe I should create this as a build command so when it compiles it executes using only virtualenv packages.
Any tips on how to get this to happen?
Probably just starting Geany after sourcing the activation script would work OK.
Yeah, thats the simple way if the entire session is to use the one env, but to use more than one env the OP needs to do it in the build commands.
I should note that each build command runs in a shell, so you can run multiple commands separated by semicolons eg "source activate; python %f".
Cheers Lex
Cheers, Matthew Brush
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Thanks for the help. I use virtualenvwrapper and am comfortable with it.
Will just start from with env at moment and play with the build commands.
Perhaps I was over thinking it.
Thanks
Sayth On 01/02/2014 10:47 AM, "Lex Trotman" elextr@gmail.com wrote:
On 1 February 2014 10:28, Matthew Brush mbrush@codebrainz.ca wrote:
On 14-01-31 03:14 PM, Sayth Renshaw wrote:
How can i use isolated environments in Geany? Thinking that maybe I should create this as a build command so when it compiles it executes using only virtualenv packages.
Any tips on how to get this to happen?
Probably just starting Geany after sourcing the activation script would work OK.
Yeah, thats the simple way if the entire session is to use the one env, but to use more than one env the OP needs to do it in the build commands.
I should note that each build command runs in a shell, so you can run multiple commands separated by semicolons eg "source activate; python %f".
Cheers Lex
Cheers, Matthew Brush
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Was thinking in django projects managing the whole projects in geany.
Sayth On 01/02/2014 10:58 AM, "Sayth Renshaw" flebber.crue@gmail.com wrote:
Thanks for the help. I use virtualenvwrapper and am comfortable with it.
Will just start from with env at moment and play with the build commands.
Perhaps I was over thinking it.
Thanks
Sayth On 01/02/2014 10:47 AM, "Lex Trotman" elextr@gmail.com wrote:
On 1 February 2014 10:28, Matthew Brush mbrush@codebrainz.ca wrote:
On 14-01-31 03:14 PM, Sayth Renshaw wrote:
How can i use isolated environments in Geany? Thinking that maybe I should create this as a build command so when it compiles it executes using only virtualenv packages.
Any tips on how to get this to happen?
Probably just starting Geany after sourcing the activation script would work OK.
Yeah, thats the simple way if the entire session is to use the one env, but to use more than one env the OP needs to do it in the build commands.
I should note that each build command runs in a shell, so you can run multiple commands separated by semicolons eg "source activate; python %f".
Cheers Lex
Cheers, Matthew Brush
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
I use the Project Plugin. Would be good if I could tie it to that to have each project assigned its own venv. Yes using workon in a build would be hard as you cannot prompt for input as to what 'workon (self)'.
Still we have the project plugin and the vc plugin both for workin on project code(as it appears to me). Pydev just asks for the venv and ties it to the project.
Will post if I come to a solution that works well.
Sayth
On Sat, Feb 1, 2014 at 8:20 PM, Frank Lanitz frank@frank.uvena.de wrote:
Am 01.02.2014 01:18, schrieb Sayth Renshaw:
Was thinking in django projects managing the whole projects in geany.
Maybe you can post your outcome at some point -> wiki maybe?
Cheers, Frank
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
On 1 February 2014 21:08, Sayth Renshaw flebber.crue@gmail.com wrote:
I use the Project Plugin. Would be good if I could tie it to that to have each project assigned its own venv. Yes using workon in a build would be hard as you cannot prompt for input as to what 'workon (self)'.
Still we have the project plugin and the vc plugin both for workin on project code(as it appears to me). Pydev just asks for the venv and ties it to the project.
Which project plugin, there are two? Or do you mean built-in projects? You can set build commands specific to the (built-in) project as well, and I think one of the plugins can also use that facility.
So if you use a built-in project, its commands can be "source activate; python %f" with the working directory set to the project directory, ie "%p"
Cheers Lex
Will post if I come to a solution that works well.
Sayth
On Sat, Feb 1, 2014 at 8:20 PM, Frank Lanitz frank@frank.uvena.de wrote:
Am 01.02.2014 01:18, schrieb Sayth Renshaw:
Was thinking in django projects managing the whole projects in geany.
Maybe you can post your outcome at some point -> wiki maybe?
Cheers, Frank
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
On 01/02/14 00:58, Sayth Renshaw wrote:
Thanks for the help. I use virtualenvwrapper and am comfortable with it.
Will just start from with env at moment and play with the build commands.
Perhaps I was over thinking it.
I don't use virtualenvwrapper and so don't know it very much. I personally rather like to work with virtualenv directly, virtualenvwrapper always caused me more troubles than it solved.
That said and putting virtualenvwrapper aside, it should be quite easy: create a project in Geany per virtualenv and adjust the build commands. Without having tested it, it should be sufficient to just use the Python executable from the bin directory of the corresponding virtualenv as this interpreter executable already knows about the paths. No sure how this works but it does. This way you can save you the hassle of activating the virtualenv. As said, I didn't test it, but I use the 'specific python executable' trick on production machines to start cronjobs and other management commands in some Django projects.
Regards, Enrico
OK using vanilla virtualenv(no wrapper) and with built in project from geany I have ~/Projects/Test/bin/activate for virtualenv.
The project is open and so %p as working directory works perfectly, however it returns error on source /bin/sh:1 :source "not found.
Updated the command to source bin/activate; python "%f" as thats the usual command line activation. still same error.
So it doesn't seem to activate, the command works ok in the terminal
Launching from a terminal with venv active does seem to work.
Sayth
On Sat, Feb 1, 2014 at 11:56 PM, Enrico Tröger enrico.troeger@uvena.dewrote:
On 01/02/14 00:58, Sayth Renshaw wrote:
Thanks for the help. I use virtualenvwrapper and am comfortable with it.
Will just start from with env at moment and play with the build commands.
Perhaps I was over thinking it.
I don't use virtualenvwrapper and so don't know it very much. I personally rather like to work with virtualenv directly, virtualenvwrapper always caused me more troubles than it solved.
That said and putting virtualenvwrapper aside, it should be quite easy: create a project in Geany per virtualenv and adjust the build commands. Without having tested it, it should be sufficient to just use the Python executable from the bin directory of the corresponding virtualenv as this interpreter executable already knows about the paths. No sure how this works but it does. This way you can save you the hassle of activating the virtualenv. As said, I didn't test it, but I use the 'specific python executable' trick on production machines to start cronjobs and other management commands in some Django projects.
Regards, Enrico
-- Get my GPG key from http://www.uvena.de/pub.asc
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
On 2 February 2014 11:12, Sayth Renshaw flebber.crue@gmail.com wrote:
OK using vanilla virtualenv(no wrapper) and with built in project from geany I have ~/Projects/Test/bin/activate for virtualenv.
The project is open and so %p as working directory works perfectly, however it returns error on source /bin/sh:1 :source "not found.
Since its executed as /bin/sh, bash run by Geany is probably in Bourne shell mode, and so you need to use the . command. source is a bash alias for that, see http://www.gnu.org/software/bash/manual/bashref.html#Shell-Builtin-Commands.
The bash in your command line is probably in bash mode and recognises source.
Cheers Lex
Updated the command to source bin/activate; python "%f" as thats the usual command line activation. still same error.
So it doesn't seem to activate, the command works ok in the terminal
Launching from a terminal with venv active does seem to work.
Sayth
On Sat, Feb 1, 2014 at 11:56 PM, Enrico Tröger enrico.troeger@uvena.dewrote:
On 01/02/14 00:58, Sayth Renshaw wrote:
Thanks for the help. I use virtualenvwrapper and am comfortable with it.
Will just start from with env at moment and play with the build
commands.
Perhaps I was over thinking it.
I don't use virtualenvwrapper and so don't know it very much. I personally rather like to work with virtualenv directly, virtualenvwrapper always caused me more troubles than it solved.
That said and putting virtualenvwrapper aside, it should be quite easy: create a project in Geany per virtualenv and adjust the build commands. Without having tested it, it should be sufficient to just use the Python executable from the bin directory of the corresponding virtualenv as this interpreter executable already knows about the paths. No sure how this works but it does. This way you can save you the hassle of activating the virtualenv. As said, I didn't test it, but I use the 'specific python executable' trick on production machines to start cronjobs and other management commands in some Django projects.
Regards, Enrico
-- Get my GPG key from http://www.uvena.de/pub.asc
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
/bin/bash -c source .bin/activate; python file1.py (in directory: /home/sayth/Projects/Test) .bin/activate: line 0: source: filename argument required source: usage: source filename [arguments] Traceback (most recent call last): File "file1.py", line 3, in <module> import django ImportError: No module named django Compilation failed.
On Sun, Feb 2, 2014 at 11:47 AM, Lex Trotman elextr@gmail.com wrote:
On 2 February 2014 11:12, Sayth Renshaw flebber.crue@gmail.com wrote:
OK using vanilla virtualenv(no wrapper) and with built in project from geany I have ~/Projects/Test/bin/activate for virtualenv.
The project is open and so %p as working directory works perfectly, however it returns error on source /bin/sh:1 :source "not found.
Since its executed as /bin/sh, bash run by Geany is probably in Bourne shell mode, and so you need to use the . command. source is a bash alias for that, see http://www.gnu.org/software/bash/manual/bashref.html#Shell-Builtin-Commands .
The bash in your command line is probably in bash mode and recognises source.
Cheers Lex
Updated the command to source bin/activate; python "%f" as thats the usual command line activation. still same error.
So it doesn't seem to activate, the command works ok in the terminal
Launching from a terminal with venv active does seem to work.
Sayth
On Sat, Feb 1, 2014 at 11:56 PM, Enrico Tröger enrico.troeger@uvena.dewrote:
On 01/02/14 00:58, Sayth Renshaw wrote:
Thanks for the help. I use virtualenvwrapper and am comfortable with
it.
Will just start from with env at moment and play with the build
commands.
Perhaps I was over thinking it.
I don't use virtualenvwrapper and so don't know it very much. I personally rather like to work with virtualenv directly, virtualenvwrapper always caused me more troubles than it solved.
That said and putting virtualenvwrapper aside, it should be quite easy: create a project in Geany per virtualenv and adjust the build commands. Without having tested it, it should be sufficient to just use the Python executable from the bin directory of the corresponding virtualenv as this interpreter executable already knows about the paths. No sure how this works but it does. This way you can save you the hassle of activating the virtualenv. As said, I didn't test it, but I use the 'specific python executable' trick on production machines to start cronjobs and other management commands in some Django projects.
Regards, Enrico
-- Get my GPG key from http://www.uvena.de/pub.asc
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
On 2 February 2014 12:29, Sayth Renshaw flebber.crue@gmail.com wrote:
/bin/bash -c source .bin/activate; python file1.py (in directory: /home/sayth/Projects/Test) .bin/activate: line 0: source: filename argument required source: usage: source filename [arguments] Traceback (most recent call last): File "file1.py", line 3, in <module> import django ImportError: No module named django Compilation failed.
Please post errors correctly, your first error seemed to say "source" was not found.
This error is saying source is ok, just that the path to your actiavte script is wrong. it should be ./bin/activate I think.
Cheers Lex
On Sun, Feb 2, 2014 at 11:47 AM, Lex Trotman elextr@gmail.com wrote:
On 2 February 2014 11:12, Sayth Renshaw flebber.crue@gmail.com wrote:
OK using vanilla virtualenv(no wrapper) and with built in project from geany I have ~/Projects/Test/bin/activate for virtualenv.
The project is open and so %p as working directory works perfectly, however it returns error on source /bin/sh:1 :source "not found.
Since its executed as /bin/sh, bash run by Geany is probably in Bourne shell mode, and so you need to use the . command. source is a bash alias for that, see http://www.gnu.org/software/bash/manual/bashref.html#Shell-Builtin-Commands .
The bash in your command line is probably in bash mode and recognises source.
Cheers Lex
Updated the command to source bin/activate; python "%f" as thats the usual command line activation. still same error.
So it doesn't seem to activate, the command works ok in the terminal
Launching from a terminal with venv active does seem to work.
Sayth
On Sat, Feb 1, 2014 at 11:56 PM, Enrico Tröger enrico.troeger@uvena.dewrote:
On 01/02/14 00:58, Sayth Renshaw wrote:
Thanks for the help. I use virtualenvwrapper and am comfortable with
it.
Will just start from with env at moment and play with the build
commands.
Perhaps I was over thinking it.
I don't use virtualenvwrapper and so don't know it very much. I personally rather like to work with virtualenv directly, virtualenvwrapper always caused me more troubles than it solved.
That said and putting virtualenvwrapper aside, it should be quite easy: create a project in Geany per virtualenv and adjust the build commands. Without having tested it, it should be sufficient to just use the Python executable from the bin directory of the corresponding virtualenv as this interpreter executable already knows about the paths. No sure how this works but it does. This way you can save you the hassle of activating the virtualenv. As said, I didn't test it, but I use the 'specific python executable' trick on production machines to start cronjobs and other management commands in some Django projects.
Regards, Enrico
-- Get my GPG key from http://www.uvena.de/pub.asc
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
On 02/02/14 01:12, Sayth Renshaw wrote:
OK using vanilla virtualenv(no wrapper) and with built in project from geany I have ~/Projects/Test/bin/activate for virtualenv.
The project is open and so %p as working directory works perfectly, however it returns error on source /bin/sh:1 :source "not found.
Updated the command to source bin/activate; python "%f" as thats the usual command line activation. still same error.
I'm afraid I wasn't clear enough about what I meant: Instead of using the 'bin/activate' script at all, just use the Python interpreter in the virtualenv's bin directory as this should know the paths already.
Something like this could be your build command:
%p/env/bin/python "%f"
(provided that your virtualenv is called 'env' in the project directory)
Regards, Enrico
Thanks Enrico that does seem to work on the file I have
using bin/python "%f" and %p as my working directory.
I can't however get a working version of a /bin/sh -c %p/bin/activate; python %f style virtualenv command. I have tried many versions but just can't get it working. This one finds activate and the file but fails.
/bin/sh -c /home/sayth/Projects/Test/bin/activate; python file1.py (in directory: /home/sayth/Projects/Test) Traceback (most recent call last): File "file1.py", line 3, in <module> import django ImportError: No module named django Compilation failed.
Sayth
On Sun, Feb 2, 2014 at 10:02 PM, Enrico Tröger enrico.troeger@uvena.dewrote:
On 02/02/14 01:12, Sayth Renshaw wrote:
OK using vanilla virtualenv(no wrapper) and with built in project from geany I have ~/Projects/Test/bin/activate for virtualenv.
The project is open and so %p as working directory works perfectly,
however
it returns error on source /bin/sh:1 :source "not found.
Updated the command to source bin/activate; python "%f" as thats the
usual
command line activation. still same error.
I'm afraid I wasn't clear enough about what I meant: Instead of using the 'bin/activate' script at all, just use the Python interpreter in the virtualenv's bin directory as this should know the paths already.
Something like this could be your build command:
%p/env/bin/python "%f"
(provided that your virtualenv is called 'env' in the project directory)
Regards, Enrico
-- Get my GPG key from http://www.uvena.de/pub.asc
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
On 3 February 2014 20:48, Sayth Renshaw flebber.crue@gmail.com wrote:
Thanks Enrico that does seem to work on the file I have
using bin/python "%f" and %p as my working directory.
I can't however get a working version of a /bin/sh -c %p/bin/activate; python %f style virtualenv command. I have tried many versions but just can't get it working. This one finds activate and the file but fails.
Did you actually include the "/bin/sh -c" as part of the command? Because, as I said before, the whole command is already prefixed by /bin/sh -c inside Geany. So then when you included it in the command it ran the part before the semicolon in a subshell, so the activate just ran in the sub-shell, and the python ran in the top level shell which didn't know any of the activate settings
Just run:
./bin/activate; python %f
with working dir %p
Cheers Lex
/bin/sh -c /home/sayth/Projects/Test/bin/activate; python file1.py (in directory: /home/sayth/Projects/Test)
Traceback (most recent call last): File "file1.py", line 3, in <module> import django ImportError: No module named django Compilation failed.
Sayth
On Sun, Feb 2, 2014 at 10:02 PM, Enrico Tröger enrico.troeger@uvena.dewrote:
On 02/02/14 01:12, Sayth Renshaw wrote:
OK using vanilla virtualenv(no wrapper) and with built in project from geany I have ~/Projects/Test/bin/activate for virtualenv.
The project is open and so %p as working directory works perfectly,
however
it returns error on source /bin/sh:1 :source "not found.
Updated the command to source bin/activate; python "%f" as thats the
usual
command line activation. still same error.
I'm afraid I wasn't clear enough about what I meant: Instead of using the 'bin/activate' script at all, just use the Python interpreter in the virtualenv's bin directory as this should know the paths already.
Something like this could be your build command:
%p/env/bin/python "%f"
(provided that your virtualenv is called 'env' in the project directory)
Regards, Enrico
-- Get my GPG key from http://www.uvena.de/pub.asc
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
On 03/02/14 11:28, Lex Trotman wrote:
On 3 February 2014 20:48, Sayth Renshaw flebber.crue@gmail.com wrote:
Thanks Enrico that does seem to work on the file I have
using bin/python "%f" and %p as my working directory.
I can't however get a working version of a /bin/sh -c %p/bin/activate; python %f style virtualenv command. I have tried many versions but just can't get it working. This one finds activate and the file but fails.
I still don't get why you want to use 'activate' in Geany so hard if it would work even without it.
Did you actually include the "/bin/sh -c" as part of the command? Because, as I said before, the whole command is already prefixed by /bin/sh -c inside Geany. So then when you included it in the command it ran the part before the semicolon in a subshell, so the activate just ran in the sub-shell, and the python ran in the top level shell which didn't know any of the activate settings
Just run:
./bin/activate; python %f
with working dir %p
Sayth, if you'll get it working in some way, it'd be cool if you could document it in the wiki, https://wiki.geany.org/howtos/start ?
Regards, Enrico
Am 03.02.2014 22:18, schrieb Enrico Tröger:
Sayth, if you'll get it working in some way, it'd be cool if you could document it in the wiki, https://wiki.geany.org/howtos/start ?
+1 ;)
Cheers, Frank
Currently, I am just starting geany from a terminal with virtualenv active. Whilst Lex's solution finds bin/activate it doesn't seem to apply to the file. Cannot locate the imports in the file that exist in the virtualenv.
Sayth On 06/02/2014 7:56 AM, "Frank Lanitz" frank@frank.uvena.de wrote:
Am 03.02.2014 22:18, schrieb Enrico Tröger:
Sayth, if you'll get it working in some way, it'd be cool if you could document it in the wiki, https://wiki.geany.org/howtos/start ?
+1 ;)
Cheers, Frank
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Am 01.02.2014 00:28, schrieb Matthew Brush:
On 14-01-31 03:14 PM, Sayth Renshaw wrote:
How can i use isolated environments in Geany? Thinking that maybe I should create this as a build command so when it compiles it executes using only virtualenv packages.
Any tips on how to get this to happen?
Probably just starting Geany after sourcing the activation script would work OK.
It's the way I do it at the moment. Bot sure it's the best solution ;)
Cheers, Frank