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