LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-01-2014, 10:48 PM   #1
flebber
Member
 
Registered: Jan 2005
Location: Newcastle, Australia
Distribution: debian stable
Posts: 394

Rep: Reputation: 30
Geany - Activate Python Virtualenv - Bourne Shell Permissions


Hi

What my goal is, is to have geany editor activate a virtualenv for my currently active file or project.

For the most part this should be easy using build commands. However geany uses the bourne shell which i have never used and bourne doesn't understand 'source bin/activate'. sSource is not a command.

Ok so in geany my command is
Code:
/bin/sh  -c "%p" /bin/activate; python %f
and my directory %p. %p represents my project directory, in this case ~/Projects/Test.
My virtualenv is located within ~/Projects/Test/bin/activate

So here's the catch now when I run this I get permission denied
Code:
/bin/sh  -c "/home/sayth/Projects/Test" /bin/activate; python file1.py (in directory: /home/sayth/Projects/Test)
/bin/activate: 1: /bin/activate: /home/sayth/Projects/Test: Permission denied
Traceback (most recent call last):
  File "file1.py", line 3, in <module>
    import django
ImportError: No module named django
Compilation failed.
So i went to /bin/sh and did
Code:
sudo chmod a+x /bin/sh
but this doesn't resolve the error.

Any ideas on how to get the bourne shell to allow me to activate my venv?
 
Old 02-02-2014, 01:08 AM   #2
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
Hi,

I'm not quite sure why you're talking about source as the equivalent in the Bourne shell is . like so:

Code:
. exec_this_in_my_current_environment
or exactly how your trying to do what you are trying to do. But if you're going to use the -c option to the Bourne shell, you're not dealing with lists in some contexts as you might with the C Shell. If you are trying to execute bin/activate from beneath /home/sayth/Projects/Test and the bin directory within /home/sayth/Projects/Test is not in your PATH value, then you need to execute:

Code:
/home/sayth/Projects/Test/bin/activate
with no spaces in the command path, but you have appear to have a space between the two tokens in what you've shown us.
 
Old 02-03-2014, 04:03 AM   #3
flebber
Member
 
Registered: Jan 2005
Location: Newcastle, Australia
Distribution: debian stable
Posts: 394

Original Poster
Rep: Reputation: 30
yeah it finds bin/activate ok, but the whole issue is that I cannot do a

Code:
source bin/activate
because its the bourne shell. Would work fine in bash but geany doesn't use that.
 
  


Reply

Tags
bourne, geany, virtualenv



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
New to Python, need some assistance with virtualenv. manwichmakesameal Slackware 2 06-23-2013 10:24 PM
[SOLVED] geany and python - indent problems szboardstretcher Linux - Software 4 08-31-2012 10:22 AM
file permissions in bourne shell script bujecas Linux - General 2 07-12-2006 11:46 AM
'sh' shell - Actually calls legacy Bourne shell, or uses system default? Dtsazza Linux - Software 1 10-28-2005 09:20 AM
Bourne Again SHell help MagInnovision Linux - Newbie 2 02-04-2003 03:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration